@trycourier/courier-react-native
v6.0.2
Published
Inbox, Push Notifications, and Preferences for React Native
Readme
Courier React Native SDK
The Courier React Native SDK provides prebuilt components and TypeScript APIs for adding in-app notifications, push notifications, and notification preferences to your React Native app. It handles authentication, token management, and real-time message delivery across iOS and Android from a single codebase.
Installation
npm install @trycourier/courier-react-nativeAlso available via yarn add @trycourier/courier-react-native.
Requires iOS 15.0+, Android SDK 23+, and Gradle 8.4+. Run cd ios && pod install after installing.
Quick Start
import Courier, {
CourierInboxView,
CourierPreferencesView,
} from "@trycourier/courier-react-native";
// Sign in the user (JWT generated by your backend)
await Courier.shared.signIn({
userId: "user_123",
accessToken: jwt,
});
// Add a prebuilt Inbox component
<CourierInboxView
onClickInboxMessageAtIndex={(message, index) => {
message.read
? Courier.shared.unreadMessage({ messageId: message.messageId })
: Courier.shared.readMessage({ messageId: message.messageId });
}}
style={{ flex: 1 }}
/>
// Add a prebuilt Preferences component
<CourierPreferencesView
mode={{ type: "topic" }}
style={{ flex: 1 }}
/>For Expo projects, see the Expo setup guide.
Documentation
Full documentation: courier.com/docs/sdk-libraries/react-native
Getting Started
These are all the available features of the SDK.
Expo
If you are using Expo, you should check out the Expo Docs for all the details.
Example Projects
Starter projects using this SDK.
Share feedback with Courier
We want to make this the best SDK for managing notifications! Have an idea or feedback about our SDKs? Let us know!
EU endpoints
If your workspace uses EU-hosted Courier endpoints, pass the built-in EU preset through apiUrls.
import Courier, { getCourierApiUrlsForRegion } from "@trycourier/courier-react-native";
await Courier.shared.signIn({
userId: "your_user_id",
accessToken: jwt,
apiUrls: getCourierApiUrlsForRegion("eu")
});