A DiiL mini app is a web page that opens inside the DiiL app, in the Apps section. It knows who the user is and can sign them in without passwords.
How it fits together #
- The user opens your mini app in DiiL.
- DiiL loads your page and passes it signed launch data (
initData). - Your page sends
initDatato your server, and your server checks the signature with your client secret. - If you need more than the basic profile, your page asks DiiL for a one-time authorization code. DiiL shows the user a consent sheet the first time.
- Your server exchanges the code for tokens and reads the user's profile.
Two ways to know the user #
Use one or both.
| What you get | When to use it | |
|---|---|---|
| initData | A signed snapshot: user id, name, @username, avatar. Your server checks the signature with your client secret. | Every launch, no extra request. Good for "who is this" and a quick session. |
| Authorization code | Tokens for the userinfo endpoint, including phone and email (if the user granted them), refreshable for 30 days. | You need contact details, or want to call DiiL later without the user. |
Next steps #
- Getting started: create your app and get credentials.
- Add the SDK: load the SDK on your page.
- Verify launch data on your server.
- Sign in with DiiL using an authorization code.