curacel-support-ai-react-native
v0.1.8
Published
React Native SDK to embed the Curacel Support AI web widget via WebView.
Readme
React Native Support AI SDK
React Native SDK that embeds the Curacel Support AI widget inside your mobile app via WebView.
Installation
npm install curacel-support-ai-react-native
npm install react-native-webview react-native-root-siblings react-native-safe-area-context
# Expo users can run: expo install react-native-webview react-native-safe-area-contextUsage
import { SupportAi } from 'curacel-support-ai-react-native';
SupportAi.init({
businessSlug: 'acme',
theme: 'light',
language: 'auto',
});
// open the widget when needed
SupportAi.open();API
- init(options) — initialize once
- open() — open the full-screen WebView overlay
- close() — close the overlay
- toggle() — toggle open/close
- setCustomer(customer) — update customer and refresh URL
- setContextTags(tags) — update tags and refresh URL
- isInitialized() — boolean
- destroy() — teardown and reset state
Options
- businessSlug (required)
- position: bottom-right | bottom-left (launcher position)
- theme: light | dark
- language: auto | english | arabic
- customer: { externalId: string; name?; email?; phone? }
- contextTags: Record<string, unknown>
- zIndex: number (overlay stacking)
- showLauncher: boolean (default true)
Notes
- Android back press closes the widget when open.
