@exode-team/sdk/miniapp/react module provides a declarative layer over ExodeMiniApp for React apps. All hooks are reactive: components re-render automatically on host events.
React is an optional peer dependency. If your project doesn’t use React, you don’t need this module — use the vanilla client.
Provider
Wraps the app, createsExodeMiniApp, performs the handshake and propagates event subscriptions:
Parameters
Client configuration:
appId, targetOrigin?, timeout?, edgeToEdge?, applyEnvironment?, applyTheme?
(see ExodeMiniApp parameters) plus renderMode?.
Unlike ExodeMiniApp, the provider has edgeToEdge and applyTheme on by default (SDK 0.4+): in the app the frame
goes under the host header and bottom menu, <body> gets padding by --exode-inset-*, and its background and text
color come from the school colors. To handle the insets or the theme yourself, pass edgeToEdge: 'manual' or
applyTheme: false — see Native look.useExodeApp
Connection state and low-level access to theExodeMiniApp instance.
In
renderMode: 'defer' mode (default), the provider’s children are not mounted while the handshake is in progress, so
the “Connecting to Exode…” branch from the example above is never rendered. To show a loading state, use
renderMode: 'immediate'.useExodeUser
The current user. Updated on theuser:updated event. isLoggedIn is true if user.id > 0;
for an unauthenticated page visitor, the host passes user.id === 0.
useExodeTheme
The current theme. Updated on thetheme:changed event. Also returns isReady — whether the theme has been received
from the host, and with a host 0.4+ — accent (the school accent, a CSS color) and colors (the host colors,
MiniAppThemeColors); with an older host they are null. Before the handshake the scheme comes from the frame name the
host sets when opening the app.
useExodeSchool
School data. Updated on theschool:updated event.
useExodeConfig
Environment configuration. Updated on theconfig:updated event. The os field (ios / android / web) comes
from a host 0.4+, with an older host it is null.
useExodeNavigation
Navigation commands for the main app.navigate(path, params) takes a route template and parameters —
see the “Navigation” section in ExodeMiniApp client.
useExodeUI
UI commands to the host. Since SDK 0.4 the hook also returnsopenLink(url, { external? }),
share({ url?, text?, title? }) and copyText(text) — see Native look.
minimize works only for pages with the “Floating window”, “Side panel” or “Fullscreen” window type
(see Custom pages). You can track minimizing with
the useExodeVisibility hook. setHeaderVisible currently has no effect on custom pages.useExodeVisibility
Whether the app is visible to the user right now. The host doesn’t unload the iframe when the user navigates to another page or minimizes the window — instead, it sendsvisibility:changed. Use
the hook to pause polling, videos and animations in the background.
useExodeInitData
The signed Init Data string from the iframe URL (#exodeInitData=...).
The value is read once, removed from the address bar and cached. This hook doesn’t need the provider.
Send the string to your backend and verify it there with the verifyInitData function — it must not be trusted in the browser.
Native look hooks (SDK 0.4+)
The host chrome hooks are described in detail on the Native look page.useExodeHeader, useExodeBackButton, useExodeMainButton and useExodeComposer return isSupported — when it is
false, render your own UI. The host has one header, one main button and one composer: one such hook per screen.
Requirements
Full example
Updated: 2026-10-22 23:06 UTC