SMeet Mini Apps
Overview
A Mini App is a web page of a bot's author that opens inside SMeet, in a window over the chat with the bot. The person signs in through SMeet with one tap, and what they fill in reaches the bot after they confirm it.
What a Mini App is#
A bot can have one Mini App. It is an ordinary web page on the author's own HTTPS server: a form, a request desk, a booking screen, a small tool. SMeet shows it in a window over the chat with the bot, tells the person whose page it is and what it receives, and connects the page to SMeet through a small script, the SDK.
- The page and its server are the author's. SMeet does not host them and does not run their code.
- The person signs in with their SMeet account without a password and without cookies: the page asks SMeet for a one-time login code, and the author's server exchanges it for a session (Sign-in).
- The page can send a result to the bot. SMeet first shows the person what goes, and the bot receives it as a
mini_app_submissionupdate in the same queue as messages (Mini Apps in the Bot API). - Mini Apps sell nothing and take no payments (Rules for authors).
How the parts fit#
| Part | Whose | What it does |
|---|---|---|
| The page | the author's | the interface; loads the SDK on every page |
| The SDK | SMeet's, inside the page | connects to the SMeet window, gets login codes, sends results to the bot (SDK) |
| The SMeet window | SMeet's | shows the consent screen, the domain of the page, the confirmation of every result; loads the page in a frame |
| The author's server | the author's | exchanges login codes for sessions and checks them with SMeet (Your server) |
| The bot | the author's | receives the results and answers in the chat (Bot API) |
A launch goes like this:
- The person presses a
mini_appbutton in the chat with the bot or opens a linkhttps://messenger.scrile.com/u/<bot>?startapp=<param>. - SMeet shows a consent screen: who made the app, what it receives about the person, and that loading the app shows the author's server their IP address and device information. Nothing goes to the author before the person presses Open.
- SMeet opens the window and loads the page of the published version.
- The page connects with
SMeetMiniApp.connect()and callsready()when its first screen is drawn. - The page signs the person in: its server gives it a one-time login attempt,
authorize()gives a code, and the server exchanges the code withexchangeLaunchCode. - The page works with its own server. Before every protected operation the server checks the session with
checkSession, without a cache. - When the person sends a form,
submitToBot()shows SMeet's confirmation, and the bot receives the form. - The bot answers in the chat, with the revision of the conversation as a condition.
Where Mini Apps open#
In the SMeet web app and in SMeet for iOS, iPadOS and macOS. On a wide screen the window stands in the middle and can be expanded; on a phone it takes the whole screen.
Other apps and older versions do not open Mini Apps: SMeet for Android, the desktop app and older versions of the web app and of SMeet for iOS show the mini_app button inactive and explain nothing. Say in the text of the message where the form opens (The mini_app button).
Two environments#
Every Mini App has two versions, each on an origin of its own and with keys of its own:
| Production | Test | |
|---|---|---|
| What opens | the published configuration, reviewed | the draft if there is one, also in review or after a refusal; otherwise the published configuration |
| Who opens it | everyone who may see the bot | the owner, the testers who accepted an invitation, the reviewers of an open review |
| Marked | "Test version, not reviewed by SMeet" in the consent screen and the window | |
| Its link | https://messenger.scrile.com/u/<bot>?startapp= | the same with &env=test |
The two environments never share a session or a result. Details are in Publishing.
What SMeet takes care of#
- The trusted screens: the consent before every launch, the domain in the bar of the window, the confirmation of every result and of every external link. A page cannot draw over them or press them.
- Who the person is: the login code goes only to the page SMeet loaded and checked, and only the author's server with the key of this app and environment can exchange it.
- Ending access: when the person stops or blocks the bot, revokes the app's access, leaves the organisation or signs out, SMeet closes the window, and
checkSessionanswersactive: falseat once.
SMeet reviews an app of the public space before it is published, but not every later change of the author's site. The author answers for the app, its data and its server (Rules for authors).
Versions#
- SDK 1.0.0, the bridge of version 1 and its bridge.schema.json.
- The author API 1.0.0 at
https://messenger.scrile.com/mini-app-api/v1, described by openapi.json. - The
mini_appbutton and themini_app_submissionupdate come with Bot API 1.2.0.
Every change is listed in the changelog.
Where to start#
- Quick start: create a Mini App and open the test version with an example.
- Examples: a form, a request desk with files and a minimal server in Python, ready to run.
- SDK, Sign-in and Your server: the three things every Mini App does.
- Publishing and Rules for authors: what review needs.