Skip to main content
The @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, creates ExodeMiniApp, 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 the ExodeMiniApp 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 the user: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 the theme:changed event. Also returns isReady — whether the theme has been received from the host.

useExodeSchool

School data. Updated on the school:updated event.

useExodeConfig

Environment configuration. Updated on the config: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 sends visibility: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

All hooks except useExodeInitData work only inside <ExodeMiniAppProvider>. Calling them outside of it throws an error.

Full example


Updated: 2026-09-28 05:04 UTC