@octokan/react-native
v0.1.6
Published
octokan in-app support chat for React Native and Expo. Works in Expo Go; one command sets it up.
Maintainers
Readme
@octokan/react-native
In-app support chat for React Native and Expo. Works in Expo Go (pure JavaScript, no native build).
npm install @octokan/react-native
npx @octokan/cli init <app key> <backend url> # both are on the Install page of your octokan dashboardIn Expo, init saves your app key to app.json and the chat configures itself, so this is all the code you need:
import { OctokanChatButton } from "@octokan/react-native";
<OctokanChatButton label="Chat with us" />In bare React Native, call Octokan.configure({ appId, baseUrl }) once at startup (init prints the exact line).
API
| | |
|---|---|
| <OctokanChatButton label /> | a button that opens the chat |
| <OctokanChatModal visible onClose /> | the chat as a sheet you control |
| <OctokanChat onClose /> | the chat screen, to embed yourself |
| Octokan.identify({ id, email, name }) | show who is writing (optional) |
| Octokan.reset() | call on sign-out |
| Octokan.deleteMyData() | lets a person erase their own chat |
Nothing is sent or stored until the person opens the chat. Messages queue offline and send themselves later.
