Skip to main content
ExodeMiniApp is the main client class. Use one instance per app. All methods are typed and return a Promise.

Creating an instance

Configuration parameters

string
required
The mini app identifier, passed to the host during the handshake. For custom pages, you can choose any value; it is not registered anywhere: the host trusts the app based on the origin of the address in the App URL (iframe) field.
string
The origin of the school page the app is opened in, for example https://my-school.exode.biz or your school’s own domain. The SDK sends messages only to this origin and accepts responses only from it. When it is not set, the SDK takes the origin of the page the frame is embedded in (location.ancestorOrigins, in Firefox — the referrer of the first load). Only if that cannot be determined does it stay * (any origin), and the SDK writes a warning to the console. In production, specify the origin explicitly.
number
Timeout for the handshake and the commands (ms). Defaults to 10000. Popups (app.popup) wait for the user’s answer with no timeout.
boolean | 'manual'
SDK 0.4+. In the app on a phone the frame goes under the header and the bottom menu of the host: true — the SDK pads <body> by --exode-inset-*, 'manual' — the app pads itself, false (default) — the host lays the frame between its chrome. See Native look.
boolean
SDK 0.4+. The host --exode-* variables and data-exode-* attributes on <html>. Defaults to true.
boolean
SDK 0.4+. The school scheme and colors on the page: color-scheme, the dark class on <html>, the background and the text color of <body> (the app’s styles win). Defaults to false; ExodeMiniAppProvider uses true.
The client must run inside an iframe. Calling init() in a top-level window throws the error ExodeMiniApp must be used inside an iframe.

Initialization

The method performs the handshake with the host and returns a MiniAppContext. Calling init() again throws an error. If the page is opened without signing in (the Available without login option), the handshake still succeeds, but ctx.user.id is 0 and the personal fields are empty, so check ctx.user.id > 0 before showing user data.
The context from init() is not signed and is suitable for display only. To reliably identify the user on your backend, use Init Data.
If the handshake does not complete within timeout ms, the Promise is rejected. Make sure the iframe is opened inside Exode and targetOrigin is correct.
path is a platform route template (not a ready-made URL); values are substituted from params:
The route templates are the same as in mobile app deep links (pageId). The host’s current route arrives in the same format in the route:changed event.
When the app is hidden (the user went to another page or minimized the window), the host ignores the navigate, navigate:back and setTabbarVisible commands.

UI commands (app.ui)

minimize() works only for pages with the Floating window, Side panel or Fullscreen window type (see Custom pages). A minimized window is not unloaded: the app receives the visibility:changed event with visible: false and keeps running.On the school’s custom pages, the host currently does not handle the setHeaderVisible command, and it has no effect.
A command’s Promise resolves when the host confirms receipt. The host also confirms commands that do nothing in the current context, so a resolved Promise does not guarantee a visible effect.

Native chrome (SDK 0.4+)

The host can do more than navigation and snackbars: the header with the ”…” menu, “Back”, a main button, a composer with a mic, popups, haptics, fullscreen, links and “Share”. In the Exode app all of these are native. What a particular host can do is shown by app.isSupported(capability).
Details are on the Native look page.

Events (app.on)

Subscribe to host events. Returns an unsubscribe function.
The full list of events and their payloads is in the Context and types section.

Getting the current context

init() returns the context once. For later access, use getContext(): since SDK 0.4 the bridge applies the theme:changed, user:updated, school:updated, config:updated, viewport:changed and context:updated events to it, so the object is always current. To learn about any change of the context, use onContextChange(listener).

Shutting down

Closes the bridge, removes the postMessage listeners and clears event handlers. Call it when the app unmounts.

Full example


Updated: 2026-10-22 23:06 UTC