Skip to content

trycourier/courier-react-native

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

408 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
banner-react-native

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-native

Also 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.

Feature Description
1 Authentication Manages user credentials between app sessions. Required if you would like to use Courier Inbox and Push Notifications.
2 Inbox An in-app notification center you can use to notify your users. Comes with a prebuilt UI and also supports fully custom UIs.
3 Push Notifications Automatically manages push notification device tokens and gives convenient functions for handling push notification receiving and clicking.
4 Preferences Allow users to update which types of notifications they would like to receive.
5 CourierClient The base level API wrapper around the Courier endpoints. Useful if you have a highly customized user experience or codebase requirements.

Expo

If you are using Expo, you should check out the Expo Docs for all the details.

Example Projects

Starter projects using this SDK.

Project Link
Example

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!

Courier React Native Issues

Packages

 
 
 

Contributors