@chatropic/react-native package renders a native chat UI that loads its branding and copy from your Mobile app deploy profile. The SDK connects to the Chatropic production host automatically, so there is no API host to configure. The SDK is currently Betaits branding and copy from your Mobile app deploy profile. The SDK connects to the Chatropic production host automatically, so there is no API host to configure. The SDK is currently Beta.
Prerequisites
- Deploy the Mobile app profile: open Deploy > Mobile app, click Deploy, and confirm the profile showsDeploy the Mobile app profile: open Deploy > Mobile app, click Deploy, and confirm the profile shows Live.
- Copy your publishable key from the Embed tab on Deploy >Copy your publishable key from the Embed tab on Deploy > Mobile app.
Install
react >= 18 and react-native >= 0.73. Optional packages unlock extra featuresPeer dependencies are react >= 18 and react-native >= 0.73. Optional packages unlock extra features:
Floating launcher
The launcher renders a floating button that opens the chat panel, matching the web widget experience:Full-screen chat
The launcher renders a floating button that opens the chat panel, matching the web widget experience:Full-screen chat
UseChatWidgetScreen for a dedicated support screen in your navigation stack:Use ChatWidgetScreen for a dedicated support screen in your navigation stack:
profile is omittedBoth components default to the mobile deploy profile when profile is omitted.
Pass signed-in user details
When your app knows who is logged in, pass user props on bothChatWidgetLauncher and ChatWidgetScreen so actions, inbox routing, and chat logs resolve to the correct person:
For production apps, also pass a backend-signed
identityToken so a modified client cannot impersonate another user. See Authentication & identity.
Pass signed-in user details
When your app knows who is logged in, pass user props on bothChatWidgetLauncher and ChatWidgetScreen so actions, inbox routing, and chat logs resolve to the correct person:
For production apps, also pass a backend-signed
identityToken so a modified client cannot impersonate another user. See Authentication & identity.
Agent BFF (recommended for signed-in apps)
If your API actions call your backend rather than a third-party OAuth providerrather than a third-party OAuth provider, use a static BFF token plusendUserId:
- In Actions > Manage tokens, create a New token with type Static value (for exampleIn Actions > Manage tokens, create a New token with type Static value (for example
my_bff). - Point actions at your backend with
Authorization: Bearer {{token.my_bff}}andX-End-User-Id: {{end_user_id}}headersbackend withAuthorization: Bearer {{token.my_bff}}andX-End-User-Id: {{end_user_id}}headers. - Mount the widget with
endUserId={user.id}.
Configurationonfiguration
The SDK fetches your deployed widget configuration at startup. Applied fields include the display name, welcome message, suggested prompts, colors, theme, logo, and privacy notice. Model settings and agent instructions stay server-sideThe SDK fetches your deployed widget configuration at startup. Applied fields include the display name, welcome message, suggested prompts, colors, theme, logo, and privacy notice. Model settings and agent instructions stay server-side.All props
Navigation deeplinks
When the agent returns a navigation card, the SDK callsonNavigate(path) with a relative path from your route registry. Wire it to your navigator:
Voice
Voice is optional and requires compatible native audio modules:All props
Navigation deeplinks
When the agent returns a navigation card, the SDK callsonNavigate(path) with a relative path from your route registry. Wire it to your navigator:
Voice
Voice is optional and requires compatible native audio modules:Current limitations
- No inline embed layout; use the launcher or full-screen chat
- Rich widgets other than
NavigationCardrender a JSON fallback - Voice requires the optional Expo audio packages
Deploy guide
Dashboard-side setup for the Mobile app profile.
Manage tokens
BFF credentials for signed-in apps.
SDK reference
Full prop and helper reference.
Embed navigation
The same navigation payload on the web.