Overview

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 #

  1. The user opens your mini app in DiiL.
  2. DiiL loads your page and passes it signed launch data (initData).
  3. Your page sends initData to your server, and your server checks the signature with your client secret.
  4. 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.
  5. 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 #