The official React Native SDK for integrating g-tateth chat into iOS and Android apps.Documentation Index
Fetch the complete documentation index at: https://docs.g-tateth.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
With the React Native SDK, clients can:- Initialize a chat session from mobile
- Send and receive messages in real time
- Render native chat UI
- Open a native help center modal before chat
- Customize chat and help center UI in-app
Installation
axios, socket.io-client, or uuid manually.
Required Configuration
GtatethChatWidget needs:
config.baseUrl(required)- Tenant identity (required):
config.tenantDomainorconfig.tenantId
customer is optional. Customer fields are optional.
Quick Integration
Help Center + Chat Flow
GtatethHelpCenter is exported from package root and opens directly as a modal.
In-App Customization
Enable runtime settings editing:APPEARANCE: chat colorsBEHAVIOR: text and behavior togglesCHATBOT: chatbot controlsHELP CENTER: help center modal colors
GtatethHelpCenter is used in the same app, saved HELP CENTER settings are automatically applied there.
Tenant Settings vs In-App Settings
Default load order:- SDK defaults
- Tenant settings from backend (
/api/widget/settings) whenuseTenantSettingsistrue - Persisted in-app customization
GtatethHelpCenter:
- Branding auto-uses tenant widget appearance colors by default
- Persisted in-app
HELP CENTERcustomization overrides those defaults - Optional
themeprop can still override specific colors directly
Prop Reference
GtatethChatWidget (main props)
config: WidgetClientConfigrequiredsessionId?: stringcustomer?: { firstName?: string; lastName?: string; email?: string; phone?: string; company?: string }context?: ChatContextsettings?: Partial<ChatWidgetSettings>theme?: Partial<ChatTheme>useTenantSettings?: booleandefaulttrueallowInAppCustomization?: booleandefaultfalsepersistInAppCustomization?: booleandefaulttruecustomizationStorageKey?: stringenableRealtime?: booleandefaulttrueonBackPress?: () => voidbackLabel?: stringdefaultBACKonReady?: (conversationId: string) => voidonError?: (error: string) => void
GtatethHelpCenter (main props)
config: WidgetClientConfigrequiredtitle?: stringsubtitle?: stringchatLabel?: stringhelpCenterLabel?: stringlauncherLabel?: string(kept for compatibility)useTenantSettings?: booleandefaulttruecustomizationStorageKey?: stringtheme?: Partial<HelpCenterTheme>onStartChat?: () => void | Promise<void>onError?: (error: string) => void
Recommended Debug Hooks
Use callbacks during integration:Local Testing (React Native)
If backend runs locally:- Android emulator base URL:
http://10.0.2.2:3001 - iOS simulator base URL:
http://localhost:3001 - Physical device base URL:
http://<your-laptop-lan-ip>:3001
Local SDK Reinstall Flow
When testing local SDK changes:Expo / Android Connectivity Checklist
If Expo Go showsCannot connect to Expo CLI:
- Stop old Expo terminals
- Run
adb reverse --remove-all - Run
adb shell pm clear host.exp.exponent - Start Expo again with
npx expo start -c --lan - Press
ato open Android - Verify emulator appears in
adb devices
Realtime Notes
Realtime now tries:websocket- fallback
polling - HTTP message refresh fallback when realtime is temporarily offline
Common Issues
-
Tenant not found -
Use the exact
tenantDomainortenantIdprovided during onboarding. - Endless loading spinner on chat init
- Confirm backend reachable from device/emulator.
-
Verify
baseUrlformat for your environment. -
Use
onErrorcallback to inspect failure text. -
Error: websocket error - Usually infra/network websocket upgrade issue.
- Fallback polling should recover after SDK update.
- Black/blank screen in Expo
- Use package-root imports only.
-
Avoid deep imports like
.../dist/ui/.... -
Clear Expo Go app data and restart Metro with
-c. - Help center customization not visible in settings
-
Enable
allowInAppCustomizationonGtatethChatWidget. -
Open settings and use the
HELP CENTERtab.
Best Practices
- Keep
SafeAreaViewwithflex: 1around SDK components. - Pass stable
sessionIdif you want continuity across remounts. - Keep
useTenantSettingsenabled for tenant-managed branding/behavior unless explicitly overriding.