React Native
Native components, SSE realtime via react-native-sse, and the push-token registration that covers the user when the app is closed.
All documentation
Getting started
Overview Quickstart SDK packagesFrontend
React Vue Svelte React Native Web Components Headless & theming Real-timeBackend API
Authentication Templates Trigger & status Contacts & preferencesMore
Self-hosting ReferenceInstall
npm install @elaanio/react-native
Components render with native primitives, so there is no stylesheet to import. Realtime uses SSE via react-native-sse, with the same polling fallback as the web packages.
Components
import { ElaanProvider, NotificationBell, NotificationFeed, Preferences } from "@elaanio/react-native"; <ElaanProvider apiBase="https://api.elaan.io/v1" tokenProvider={tokenProvider}> <NotificationBell /> <NotificationFeed /> <Preferences /> </ElaanProvider>
The hooks are the same as the React package (useNotifications, useUnreadCount, usePreferences, usePush), so code moves between the two with little more than an import change.
Push tokens
The in-app inbox covers a user who has the app open. Push covers the rest, so a mobile integration usually registers a device token as soon as permission is granted:
import { usePush } from "@elaanio/react-native"; // or /react, /vue const { register, unregister } = usePush(); // provider: "fcm" | "apns" | "expo" | "onesignal" | "webpush" await register(deviceToken, "expo", "ios"); // platform: ios | android | web
The SDK sends the token under the signed-in contact, so you never handle the mapping yourself. Call unregister on sign-out to stop delivery to that device.
Backgrounding
A missed realtime signal is never a lost notification. When the app returns to the foreground the client reconciles against the durable inbox over REST, so anything that arrived while the socket was down appears on reconnect. That is why the inbox is the source of truth and the stream is only an accelerator.