Skip to Content
Docs
Packages

@helpwren/react-native

Reference for @helpwren/react-native, the support screen and push helpers for React Native and Expo.

The setup guide is React Native and Expo. This page lists every export.

Install

Terminal
npm install @helpwren/react-native
npx expo install react-native-webview

react (19 or later), react-native (0.79 or later) and react-native-webview (13.12 or later) are peer dependencies, so your app owns their versions. No Supabase client goes into the app.

SupportScreen

The chat as a screen.

PropTypeWhat it does
baseUrlstringYour install's address
sourcestringWhich of the install's sources this app is
tokenstring | () => string | Promise<string>The logged-in user's token, checked as Settings → Identity says. Leave out for guests
contextPageContextPlain values your team sees beside the conversation. See Context
conversationIdstringOpens that conversation, for a tapped notification
onUnread(count: number) => voidCalled with the number of unread replies whenever it changes
onIdentity(state: IdentityState) => voidCalled when the chat signs in as your user, goes back to a guest, or fails to sign in
onClose() => voidShows a close button in the chat that calls this
styleStyleProp<ViewStyle>The web view's style

getUnreadCount

Signature
getUnreadCount({ baseUrl, token }): Promise<UnreadCountResult>

How many replies the user has not read, for a badge outside the screen. Returns { ok: true, count }, or { ok: false, reason } with reason one of expired, rejected or unavailable.

registerSupportDevice

Signature
registerSupportDevice({ baseUrl, pushToken, provider, platform, source, token }): Promise<SupportDeviceResult>

Registers the phone for push notifications.

OptionTypeWhat it is
baseUrlstringYour install's address
pushTokenstringThe Expo push token, or the FCM registration token
provider"expo" | "fcm"Which service the token is for. Default expo
platform"ios" | "android"The phone's platform
sourcestringThe app's source
tokenstringThe logged-in user's token

unregisterSupportDevice

Signature
unregisterSupportDevice({ baseUrl, pushToken }): Promise<SupportDeviceResult>

Stops pushes to the phone. Call it on logout.

Both device functions return { ok: true }, or { ok: false, reason } with reason one of expired, rejected, invalid or unavailable.

supportConversationId

Signature
supportConversationId(data: unknown): string | null

The conversation a notification is about, from its data, or null when it is not a Helpwren notification.

@helpwren/react-native/bridge

The messages between the app and the chat, on their own, for a custom screen. See Other platforms.

Its changes are listed in packages/react-native/CHANGELOG.md.