@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
ExodeMiniAppProviderConfig
required
Client configuration:
appId, targetOrigin?, timeout? (see ExodeMiniApp parameters) plus renderMode?.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.
useExodeSchool
School data. Updated on theschool:updated event.
useExodeConfig
Environment configuration. Updated on theconfig:updated event.
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.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.
Requirements
Full example
Updated: 2026-09-28 05:04 UTC