Minimal sample app demonstrating @ethora/chat-component-rn — drop the SDK into a fresh Expo project, paste a JWT, get a working chat.
Pinned to SDK 26.5.4.
Two-screen flow, no router:
- Setup — paste your Ethora
baseUrland JWT, confirm XMPP host fields. - Chat — renders
<XmppProvider><Chat /></XmppProvider>with the config from screen 1.
That's it. Once you tap Connect, the SDK owns the rest — room list, room chat, media send/receive (image, video, audio, document), typing indicators, unread tracking, edits, replies, reactions. Use this app to smoke-test the SDK against your own Ethora deployment, or against the default chat.ethora.com cloud.
- Node 18+
- Xcode 16+ (for iOS) / Android Studio with an emulator (for Android)
- Sign up at app.chat.ethora.com to get a JWT app token
git clone https://github.com/dappros/ethora-sample-react-native.git
cd ethora-sample-react-native
npm installAbout the Expo packages: starting with SDK
26.5.3,expo-av,expo-clipboard,expo-document-picker,expo-image-manipulator,expo-image-picker, andexpo-media-libraryare declared aspeerDependenciesof the SDK (not as bundled transitive deps). They're listed in this sample'spackage.jsonsonpm installpulls everything in one shot. If you're integrating the SDK into your own app instead, runnpx expo install expo-av expo-clipboard expo-document-picker expo-image-manipulator expo-image-picker expo-media-libraryonce (or only the ones you actually need — they're all optional).
npm run iosFirst run prebuilds the iOS project (ios/ directory) from app.json, installs CocoaPods, and launches the iOS simulator. Subsequent runs reuse the cached prebuild.
npm run androidBoots an Android emulator (or attaches to a connected device), then builds and installs the dev app.
npm startExpo Go works for the bare chat UI but won't load the native modules the SDK pulls in (push notifications, file system writes). For a full smoke test, use the prebuild flows above.
The Setup screen exposes the five fields you need for the default Ethora cloud:
| Field | Default | Notes |
|---|---|---|
| JWT | (empty) | App-level token from the Ethora dashboard. Passed as customAppToken and jwtLogin.token. |
| API base URL | https://api.chat.ethora.com/v1 |
REST endpoint. Change for self-hosted / QA. |
| XMPP WebSocket | wss://xmpp.chat.ethora.com/ws |
XMPP socket. |
| XMPP host | xmpp.chat.ethora.com |
Domain in JIDs / SASL. |
| XMPP MUC conference | conference.xmpp.chat.ethora.com |
MUC subdomain. |
To pin the app to a specific Ethora deployment, edit the DEFAULTS constant at the top of App.tsx.
A pass-checklist for verifying an SDK release:
- App boots without red-screen errors
- JWT auth succeeds — room list populates
- Send + receive text in an existing room
- Send + receive image (gallery + camera)
- Send + receive video (gallery + camera)
- Send + receive document (PDF, DOCX)
- Receive audio plays back
- Typing indicator visible on the other side
- Unread badge increments on background, clears on view
- iOS keyboard lifts the input cleanly
- Android keyboard opens without flicker
-
tsc --noEmitin this project passes (npm run tsc)
The last item validates that the SDK ships clean .d.ts files — consumer's tsc should not descend into the SDK source.
| File | Role |
|---|---|
App.tsx |
Setup form → Chat mount. The only application code. |
index.js |
Expo registration. Polyfills crypto.getRandomValues and react-native-gesture-handler before anything that needs them. |
app.json |
Expo config: bundle ids, iOS privacy strings, Android permissions, plugin pre-build hooks. |
package.json |
Pins SDK + every peer dep at the version the SDK was built against. |
babel.config.js |
babel-preset-expo + react-native-worklets/plugin (required by react-native-reanimated v4 which the SDK uses for keyboard animation). |
metro.config.js |
Default Expo Metro config. |
tsconfig.json |
Strict mode + skipLibCheck: true — matches how a real RN consumer would set up. |
npm install @ethora/chat-component-rn@latestThen re-run npm run ios / npm run android. If the SDK bumped a peer dep, you may need to update the corresponding entry in package.json too — check the SDK's peerDependencies block.