> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exode.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to MiniApp

> Concept and architecture of embedded mini apps in Exode

A MiniApp is an external web application that opens in an `iframe` inside the main Exode app. A school connects
it through a [custom page](https://docs.exode.biz/en/customization/custom-pages.md). The SDK provides two-way communication between the
mini app and the host via `postMessage` and helps you verify the signature of user data on your server.

## Architecture

```
Exode App (host)          ◄── postMessage ──►      MiniApp (iframe)
• sends context                                         • receives user, school, theme
• listens for commands                                  • sends commands (navigate, snackbar)
• pushes updates                                        • subscribes to events
```

> [!NOTE]
>
> The host side of the bridge is implemented inside the main Exode app. The guest side (what the MiniApp developer includes) is `@exode-team/sdk/miniapp`.

## Lifecycle

**1. Loading the iframe**

The main app opens the MiniApp by URL in an `iframe` and appends signed user data to the address —
`#exodeInitData=...` (see [Init Data](https://docs.exode.biz/en/exode-sdk/miniapp/init-data.md)).

**2. Handshake**

The MiniApp calls `app.init()` and sends its `appId` to the host. The host checks the message origin (for custom
pages, the origin of the address from "App URL (iframe)"; `appId` can be anything in this case) and returns the context
(user, school, theme, config).

**3. Operation**

The MiniApp sends commands (`navigate`, `showSnackbar`, ...). The host pushes events (`theme:changed`, `user:updated`, ...).

**4. Shutdown**

On unmount, the MiniApp calls `app.destroy()` — the bridge closes its listeners and releases resources.

## What is available to a MiniApp

> [accordion] Host context
>
> * User profile (name, avatar, email, role, language)
> * School object
> * Current theme (`light` / `dark`), with a host 0.4+ — the school accent and colors
> * Platform (`web` / `native`), system (`ios` / `android` / `web`) and device (`isDesktop` / `isMobile`)
> * The frame position and the insets under the host chrome, the list of host capabilities

> [accordion] Commands to the host
>
> * Navigation within the main app
> * Showing snackbar notifications
> * Controlling tabbar / header visibility
> * Closing the mini app
> * Since SDK 0.4 — the [native chrome](https://docs.exode.biz/en/exode-sdk/miniapp/native.md): the header with the "…" menu, "Back", the
>   main button, the composer with a mic, popups, haptics, fullscreen, links and "Share"

> [accordion] Reactive events
>
> * Theme, user, school and config changes
> * Host route changes
> * iframe visibility and position changes (`viewport:changed`)
> * Presses in the host chrome: "…" menu items, "Back", the main button, composer submits

## What's next

> [card] [ExodeMiniApp client](https://docs.exode.biz/en/exode-sdk/miniapp/client.md)
>
> Vanilla JS client: init, route, ui, events.

> [card] [Context and types](https://docs.exode.biz/en/exode-sdk/miniapp/context.md)
>
> MiniAppContext structure, event and command types.

> [card] [React hooks](https://docs.exode.biz/en/exode-sdk/miniapp/react.md)
>
> Provider and reactive hooks for React apps.

> [card] [Native look](https://docs.exode.biz/en/exode-sdk/miniapp/native.md)
>
> The host header, "Back", main button, composer, popups and haptics.

> [card] [Init Data](https://docs.exode.biz/en/exode-sdk/miniapp/init-data.md)
>
> Signed user data and how to verify it on your server.

> [card] [Telegram Mini App](https://docs.exode.biz/en/customization/tg-mini-app.md)
>
> Auto sign-in via the `___uat` parameter.

***

*Updated: 2026-10-22 23:06 UTC*


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.