diff --git a/Docs/1_Authentication.md b/Docs/1_Authentication.md
deleted file mode 100644
index a8304b0..0000000
--- a/Docs/1_Authentication.md
+++ /dev/null
@@ -1,136 +0,0 @@
-> **Note**: These docs have moved to [courier.com/docs/sdk-libraries/react-native](https://www.courier.com/docs/sdk-libraries/react-native/). The content below may be outdated.
-
-# Authentication
-
-Manages user credentials between app sessions.
-
-
-
-## SDK Features that need Authentication
-
-
-
-
- | Feature |
- Reason |
-
-
-
-
-
-
- Courier Inbox
-
- |
-
- Needs Authentication to view inbox messages that belong to a user.
- |
-
-
-
-
- Push Notifications
-
- |
-
- Needs Authentication to sync push notification device tokens to the current user and Courier.
- |
-
-
-
-
- Preferences
-
- |
-
- Needs Authentication to manage user notification preferences.
- |
-
-
-
-
-
-
-# Getting Started
-
-Put this code where you normally manage your user's state. The user's access to [`Inbox`](https://github.com/trycourier/courier-react-native/blob/master/Docs/2_Inbox.md), [`Push Notifications`](https://github.com/trycourier/courier-react-native/blob/master/Docs/3_PushNotifications.md) and [`Preferences`](https://github.com/trycourier/courier-react-native/blob/master/Docs/4_Preferences.md) will automatically be managed by the SDK and stored in persistent storage. This means that if your user fully closes your app and starts it back up, they will still be "signed in".
-
-
-
-## 1. Generate a JWT
-
-To generate a JWT, you will need to:
-1. Create an endpoint on your backend
-2. Call this function inside that endpoint: [`Generate Auth Tokens`](https://www.courier.com/docs/reference/auth/issue-token/)
-3. Return the JWT
-
-Here is a curl example with all the scopes needed that the SDK uses. Change the scopes to the scopes you need for your use case.
-
-```curl
-curl --request POST \
- --url https://api.courier.com/auth/issue-token \
- --header 'Accept: application/json' \
- --header 'Authorization: Bearer $YOUR_AUTH_KEY' \
- --header 'Content-Type: application/json' \
- --data
- '{
- "scope": "user_id:$YOUR_USER_ID write:user-tokens inbox:read:messages inbox:write:events read:preferences write:preferences read:brands",
- "expires_in": "$YOUR_NUMBER days"
- }'
-```
-
-## 2. Get a JWT in your app
-
-```javascript
-const userId = "your_user_id";
-const jwt = await YourBackend.generateCourierJWT(userId);
-```
-
-## 3. Sign your user in
-
-Signed in users will stay signed in between app sessions.
-
-```javascript
-import Courier from "@trycourier/courier-react-native";
-const userId = "your_user_id";
-await Courier.shared.signIn({ userId: userId, accessToken: jwt });
-```
-
-For EU-hosted workspaces, pass the built-in EU endpoint preset:
-
-```javascript
-import Courier, { getCourierApiUrlsForRegion } from "@trycourier/courier-react-native";
-
-await Courier.shared.signIn({
- userId: userId,
- accessToken: jwt,
- apiUrls: getCourierApiUrlsForRegion("eu")
-});
-```
-
-If the token is expired, you can generate a new one from your endpoint and call `Courier.shared.signIn(...)` again. You will need to check the token manually for expiration or generate a new one when the user views a specific screen in your app. It is up to you to handle token expiration and refresh based on your security needs.
-
-## 4. Sign your user out
-
-This will remove any credentials that are stored between app sessions.
-
-```javascript
-import Courier from "@trycourier/courier-react-native";
-await Courier.shared.signOut();
-```
-
-## All Available Authentication Values
-
-```javascript
-const userId = Courier.shared.userId;
-const tenantId = Courier.shared.tenantId;
-const isUserSignedIn = Courier.shared.isUserSignedIn;
-
-const listener = Courier.shared.addAuthenticationListener({
- onUserChanged: (userId) => {
- console.log('User changed:', userId);
- },
-});
-
-listener.remove();
-```
diff --git a/Docs/2_Inbox.md b/Docs/2_Inbox.md
deleted file mode 100644
index e36e082..0000000
--- a/Docs/2_Inbox.md
+++ /dev/null
@@ -1,499 +0,0 @@
-
-
-> **Note**: These docs have moved to [courier.com/docs/sdk-libraries/react-native](https://www.courier.com/docs/sdk-libraries/react-native/). The content below may be outdated.
-
-
-
-# Courier Inbox
-
-An in-app notification center list you can use to notify your users. Allows you to build high quality, flexible notification feeds very quickly.
-
-## Requirements
-
-
-
-
-
-# JWT Authentication
-
-If you are using JWT authentication, be sure to enable JWT support on the Courier Inbox Provider [`here`](https://app.courier.com/integrations/catalog/courier).
-
-
-
-
-
-## Default Inbox Example
-
-The default `CourierInboxView` styles.
-
-
-
-
-#### ⚠️ Important Android Requirement
-
-Because Courier Inbox uses Android's Material theme and your app's styles as the default colors, you need to make sure your `styles.xml` theme parent extends `MaterialComponents`.
-
-In your `res/values/styles.xml` set the follow:
-
-```xml
-
-
-
-
-
-
-
-
-
-```
-
-
-
-In your React Native project, add the View to your app:
-
-```javascript
-import { CourierInboxView } from '@trycourier/courier-react-native';
-
- {
- console.log(message)
- message.read ? Courier.shared.unreadMessage({ messageId: message.messageId }) : Courier.shared.readMessage({ messageId: message.messageId })
- }}
- onClickInboxActionForMessageAtIndex={(action, message, index) => {
- console.log(action)
- }}
- style={...}
-/>
-```
-
-
-
-## Styled Inbox Example
-
-The styles you can use to quickly customize the `CourierInboxView`.
-
-
-
-
-#### ⚠️ Android Theme Requirement
-
-Be sure to add support for the material theme. More info [`here`](https://github.com/trycourier/courier-react-native/blob/master/Docs/2_Inbox.md#%EF%B8%8F-important-android-requirement).
-
-Setting `CourierInboxTheme` will override your app's default `styles.xml` theme.
-
-#### Custom Fonts:
-
-iOS fonts point to the name of the font you have loaded into your app's fonts resources. More about that can be found [`here`](https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app).
-
-Android fonts point to system fonts with the path included. More about Android fonts [`here`](https://developer.android.com/develop/ui/views/text-and-emoji/fonts-in-xml).
-
-#### Custom Icons:
-
-Add the icons to your native app as Drawables on Android and Images assets on iOS. Then simply pass the name of the file to `CourierInboxTheme`.
-
-```javascript
-import { CourierInboxView } from '@trycourier/courier-react-native';
-
-const textColor = '#2A1537';
-const primaryColor = '#882DB9';
-const secondaryColor = '#EA6866';
-
-const titleFont = Platform.OS === 'ios' ? 'Avenir Black' : 'fonts/poppins_regular.otf';
-const defaultFont = Platform.OS === 'ios' ? 'Avenir Medium' : 'fonts/poppins_regular.otf';
-
-const lightTheme: CourierInboxTheme = {
- brandId: "your_brand_id",
- tabIndicatorColor: primaryColor,
- tabStyle: {
- selected: {
- font: {
- family: titleFont,
- size: 16,
- color: textColor
- },
- indicator: {
- font: {
- family: titleFont,
- size: 14,
- color: '#FFFFFF'
- },
- color: primaryColor
- }
- },
- unselected: {
- font: {
- family: titleFont,
- size: 16,
- color: textColor
- },
- indicator: {
- font: {
- family: titleFont,
- size: 14,
- color: '#000000'
- },
- color: secondaryColor
- }
- }
- },
- readingSwipeActionStyle: {
- read: {
- icon: Platform.OS === 'ios' ? 'icon_ios_undo' : 'icon_android_undo',
- color: textColor
- },
- unread: {
- icon: Platform.OS === 'ios' ? 'icon_ios_check' : 'icon_android_check',
- color: primaryColor
- }
- },
- archivingSwipeActionStyle: {
- archive: {
- icon: Platform.OS === 'ios' ? 'icon_ios_archive' : 'icon_android_archive',
- color: secondaryColor
- }
- },
- unreadIndicatorStyle: {
- indicator: 'dot',
- color: primaryColor
- },
- titleStyle: {
- unread: {
- family: titleFont,
- size: 14,
- color: textColor
- },
- read: {
- family: titleFont,
- size: 14,
- color: textColor
- }
- },
- timeStyle: {
- unread: {
- family: defaultFont,
- size: 12,
- color: textColor
- },
- read: {
- family: defaultFont,
- size: 12,
- color: textColor
- }
- },
- bodyStyle: {
- unread: {
- family: defaultFont,
- size: 12,
- color: textColor
- },
- read: {
- family: defaultFont,
- size: 12,
- color: textColor
- }
- },
- buttonStyle: {
- unread: {
- font: {
- family: defaultFont,
- size: 12,
- color: '#FFFFFF'
- },
- backgroundColor: primaryColor,
- cornerRadius: 8
- },
- read: {
- font: {
- family: defaultFont,
- size: 12,
- color: textColor
- },
- backgroundColor: secondaryColor,
- cornerRadius: 8
- }
- },
- infoViewStyle: {
- font: {
- family: titleFont,
- size: 14,
- color: textColor
- },
- button: {
- font: {
- family: defaultFont,
- size: 12,
- color: primaryColor
- },
- backgroundColor: textColor,
- cornerRadius: 8
- }
- },
- iOS: {
- messageAnimationStyle: 'right',
- cellStyles: {
- separatorStyle: 'singleLineEtched',
- separatorInsets: {
- top: 0,
- left: 0,
- right: 0,
- bottom: 0
- }
- }
- },
- android: {
- dividerItemDecoration: 'vertical'
- }
-};
-
-const darkTheme: CourierInboxTheme = {
- tabIndicatorColor: primaryColor,
-};
-
- {
- console.log(message)
- message.read ? Courier.shared.unreadMessage({ messageId: message.messageId }) : Courier.shared.readMessage({ messageId: message.messageId });
- }}
- onClickInboxActionForMessageAtIndex={(action, message, index) => {
- console.log(action);
- }}
- onScrollInbox={(y, x) => {
- console.log(`Inbox scroll offset y: ${y}`);
- }}
- style={...}
-/>
-```
-
-
-
-## Custom Inbox Example
-
-The raw data you can use to build any UI you'd like.
-
-```javascript
-import Courier from '@trycourier/courier-react-native';
-
-const Page = () => {
-
- const [isLoading, setIsLoading] = useState(false);
- const [error, setError] = useState(null);
- const [inbox, setInbox] = useState();
-
- useEffect(() => {
-
- const initInbox = async () => {
-
- await Courier.shared.setInboxPaginationLimit({ limit: 100 });
-
- const inboxListener = await Courier.shared.addInboxListener({
- onInitialLoad() {
- setIsLoading(true);
- },
- onError(error) {
- setIsLoading(false);
- setError(error);
- },
- onFeedChanged(messageSet) {
- setIsLoading(false);
- setError(null);
- setInbox(messageSet);
- },
- });
-
- };
-
- initInbox();
-
- }, []);
-
- if (isLoading) {
- return Loading
- }
-
- if (error) {
- return {error}
- }
-
- return (
- message.messageId}
- renderItem={message => }
- refreshControl={
-
- }
- ListFooterComponent={() => {
- return inbox?.canPaginate ? : null
- }}
- onEndReached={() => {
- if (inbox?.canPaginate) {
- Courier.shared.fetchNextPageOfMessages({ inboxMessageFeed: 'feed' });
- }
- }}
- />
- )
-
-}
-```
-
-
-
-## Full Examples
-
-
-
-
-
-## Available Properties and Functions
-
-```javascript
-// Pagination limit
-await Courier.shared.inboxPaginationLimit = 100;
-
-// Inbox listener
-const listener = await Courier.shared.addInboxListener({
- onInitialLoad() {
- ..
- },
- onError(error) {
- ..
- },
- onFeedChanged(messageSet) {
- ..
- },
- onMessageChanged(feed, index, message) {
- if (feed === 'feed') {
- ..
- }
- },
- onMessageAdded(feed, index, message) {
- if (feed === 'feed') {
- ..
- }
- },
- onMessageRemoved(feed, index) {
- if (feed === 'feed') {
- ..
- }
- },
- onPageAdded(feed, messageSet) {
- if (feed === 'feed') {
- ..
- }
- }
-});
-listener.remove();
-
-// Remove the listener
-await Courier.shared.removeInboxListener({ listenerId: 'asdf' });
-
-// Remove all listeners
-// Warning: This will remove ALL listeners. Use at own risk.
-await Courier.shared.removeAllInboxListeners();
-
-// Refresh inbox
-await Courier.shared.refreshInbox();
-
-// Read all messages
-await Courier.shared.readAllInboxMessages();
-
-// Updating messages
-await Courier.shared.openMessage({ messageId: 'asdf' });
-await Courier.shared.clickMessage({ messageId: 'asdf' });
-await Courier.shared.readMessage({ messageId: 'asdf' });
-await Courier.shared.unreadMessage({ messageId: 'asdf' });
-await Courier.shared.archiveMessage({ messageId: 'asdf' });
-
-// Fetch a new page of messages
-cosnt newMessages = await Courier.shared.fetchNextPageOfMessages();
-```
-
diff --git a/Docs/3_PushNotifications.md b/Docs/3_PushNotifications.md
deleted file mode 100644
index 3779148..0000000
--- a/Docs/3_PushNotifications.md
+++ /dev/null
@@ -1,520 +0,0 @@
-
-
-> **Note**: These docs have moved to [courier.com/docs/sdk-libraries/react-native](https://www.courier.com/docs/sdk-libraries/react-native/). The content below may be outdated.
-
-
-
-# Push Notifications
-
-The easiest way to support push notifications in your app.
-
-## Features
-
-
-
-
- | Feature |
- Description |
- iOS |
- Android |
-
-
-
-
-
- Automatic Token Management
- |
-
- Push notification tokens automatically sync to the Courier studio.
- |
-
- ✅
- |
-
- ✅
- |
-
-
-
- Notification Tracking
- |
-
- Track if your users received or clicked your notifications even if your app is not runnning or open.
- |
-
- ✅
- |
-
- ✅
- |
-
-
-
- Permission Requests & Checking
- |
-
- Simple functions to request and check push notification permission settings.
- |
-
- ✅
- |
-
- ✅
- |
-
-
-
-
-
-
-## Requirements
-
-
-
-
- | Requirement |
- Reason |
-
-
-
-
-
-
- Authentication
-
- |
-
- Needs Authentication to sync push notification device tokens to the current user and Courier.
- |
-
-
-
-
- A Configured Provider
-
- |
-
- Courier needs to know who to route the push notifications to so your users can receive them.
- |
-
-
-
-
-
-
-
-
-
-
-# Manual Token Syncing
-
-To manually sync tokens, use the following code.
-
-```javascript
-// To set the token in the Courier
-await Courier.shared.setToken({
- key: 'YOUR_PROVIDER',
- token: 'example_token'
-});
-
-// Or
-
-await Courier.shared.setTokenForProvider({
- provider: CourierPushProvider.EXPO,
- token: 'example_token'
-});
-
-// To get the token stored in the SDK
-// This does not get it from the Courier API, just from the SDK's local storage
-const tokenForProvider = await Courier.shared.getTokenForProvider({
- provider: CourierPushProvider.EXPO
-});
-
-// Or
-
-const tokenForKey = await Courier.shared.getToken({
- key: 'YOUR_PROVIDER'
-});
-```
-
-
-
-# Automatic Token Syncing
-
-To allow the Courier SDK to automatically sync tokens, use the following steps.
-
-# iOS Setup
-
-
-
-
- | Requirement |
- Reason |
-
-
-
-
-
-
- Apple Developer Membership
-
- |
-
- Apple requires all iOS developers to have a membership so you can manage your push notification certificates.
- |
-
-
- |
- A phyical iOS device
- |
-
- Although you can setup the Courier SDK without a device, a physical device is the only way to fully ensure push notification tokens and notification delivery is working correctly. Simulators are not reliable.
- |
-
-
-
-
-
-
-## 1. Enable the "Push Notifications" capability
-
-https://user-images.githubusercontent.com/29832989/204891095-1b9ac4f4-8e5f-4c71-8e8f-bf77dc0a2bf3.mov
-1. Select your Xcode project file
-2. Click your project Target
-3. Click "Signing & Capabilities"
-4. Click the small "+" to add a capability
-5. Press Enter
-
-## 2. Support Notification Callbacks and Automatic APNS Token syncing
-
-In Xcode, change your `AppDelegate.h` to use this snippet.
-
-```objective-c
-#import
-
-@interface AppDelegate : CourierReactNativeDelegate
-@end
-```
-
-## 3. Add the Notification Service Extension (Optional, but recommended)
-
-To make sure Courier can track when a notification is delivered to the device, you need to add a Notification Service Extension. Here is how to add one.
-
-https://github.com/trycourier/courier-react-native/assets/6370613/c3dcd451-e24a-4a0f-8676-36239d817ddb
-
-1. Download and Unzip the Courier Notification Service Extension: [`CourierNotificationServiceTemplate.zip`](https://github.com/trycourier/courier-notification-service-extension-template/archive/refs/heads/main.zip)
-2. Open the folder in terminal and run `sh make_template.sh`
- - This will create the Notification Service Extension on your mac to save you time
-3. Open your iOS app in Xcode and go to File > New > Target
-4. Select "Courier Service" and click "Next"
-5. Give the Notification Service Extension a name (i.e. "CourierService").
-6. Click Finish
-7. Go into your CourierService target > Build Settings > Search "ENABLE_USER"
-8. Set "User Script Sandboxing" to "No"
-
-### Link the Courier SDK to your extension:
-
-1. Add the following snippet to the bottom of your Podfile
-
-```ruby
-target 'CourierService' do
- pod 'Courier_iOS'
-end
-```
-
-2. Run `pod install`
-
-
-
-# Android Setup
-
-
-
-
- | Requirement |
- Reason |
-
-
-
-
-
-
- Firebase Account
-
- |
-
- Needed to send push notifications out to your Android devices. Courier recommends you do this for the most ideal developer experience.
- |
-
-
- |
- A phyical Android device
- |
-
- Although you can setup the Courier SDK without a physical device, a physical device is the best way to fully ensure push notification tokens and notification delivery is working correctly. Simulators are not reliable.
- |
-
-
-
-
-
-
-## 1. Add Firebase
-
-1. Open Android project
-2. Register your app in Firebase and download your `google-services.json` file
-3. Add the `google-services.json` file to your `yourApp/app/src` directory
-4. Add the `google-services` dependency to your `yourApp/android/build.gradle` file:
-
-```groovy
-buildscript {
- dependencies {
- ..
- classpath("com.google.gms:google-services:4.3.14") // Add this line
- }
-}
-```
-
-5. Add the following to the top of your `/android/app/build.gradle` file:
-
-```groovy
-apply plugin: "com.android.application"
-apply plugin: "com.google.gms.google-services" // Add this line
-```
-
-6. Add Firebase Messaging to your `/android/app/build.gradle` dependencies:
-
-```groovy
-dependencies {
- implementation platform('com.google.firebase:firebase-bom:XXXX')
- implementation "com.google.firebase:firebase-messaging"
-}
-```
-
-7. Run Gradle Sync
-
-## 2. Support Notification Callbacks and Automatic FCM Token syncing
-
-1. Change your `MainActivity` to extend the `CourierReactNativeActivity`
- - This allows Courier to handle when push notifications are delivered and clicked
-2. Create a new `FirebaseMessagingService` subclass to handle push notification delivery and token management
-
-```java
-package your.app.package;
-
-import androidx.annotation.NonNull;
-import com.courier.android.Courier;
-import com.courier.android.notifications.CourierPushNotificationIntent;
-import com.courier.android.notifications.RemoteMessageExtensionsKt;
-import com.google.firebase.messaging.FirebaseMessagingService;
-import com.google.firebase.messaging.RemoteMessage;
-
-public class YourNotificationService extends FirebaseMessagingService {
-
- @Override
- public void onMessageReceived(@NonNull RemoteMessage message) {
- super.onMessageReceived(message);
-
- // Notify the Courier SDK a push was delivered
- Courier.Companion.onMessageReceived(message.getData());
-
- // Create the PendingIntent that opens your Activity when the notification is tapped
- CourierPushNotificationIntent notificationIntent = new CourierPushNotificationIntent(
- this,
- 0,
- MainActivity.class,
- message
- );
-
- // Show the notification to the user
- // Falls back to notification payload fields if data keys are missing
- String title = message.getData().get("title");
- if (title == null && message.getNotification() != null) {
- title = message.getNotification().getTitle();
- }
-
- String body = message.getData().get("body");
- if (body == null && message.getNotification() != null) {
- body = message.getNotification().getBody();
- }
-
- RemoteMessageExtensionsKt.presentNotification(
- notificationIntent,
- title,
- body,
- android.R.drawable.ic_dialog_info,
- "Notification Service"
- );
- }
-
- @Override
- public void onNewToken(@NonNull String token) {
- super.onNewToken(token);
-
- // Sync the new FCM token with Courier
- Courier.Companion.onNewToken(token);
- }
-
-}
-```
-
-3. Add the Notification Service entry in your `AndroidManifest.xml` file
-
-```xml
-
-
-
-
- ..
-
-
-
-
-
-
-
-
-
- ..
-
-
-
-```
-
-
-
-## **Support Notifications**
-
-```typescript
-// Support the type of notifications you want to show on iOS
-Courier.setIOSForegroundPresentationOptions({
- options: 'sound' | 'badge' | 'list' | 'banner'
-});
-
-// Request / Get Notification Permissions
-final currentPermissionStatus = await Courier.getNotificationPermissionStatus();
-final requestPermissionStatus = await Courier.requestNotificationPermission();
-
-// Handle push events
-const pushListener = Courier.shared.addPushListener(
- onPushClicked: (push) => {
- console.log(push);
- },
- onPushDelivered: (push) => {
- console.log(push);
- },
-);
-
-// Remove the listener where makes sense to you
-pushListener.remove();
-
-// Tokens
-await Courier.shared.setToken({ key: "...", token: "..." });
-await Courier.shared.getToken({ key: "..." });
-const tokens = await Courier.shared.getAllTokens();
-```
-
-## **Send a Message**
-
-
-
----
-
-👋 `TokenManagement APIs` can be found here
diff --git a/Docs/4_Preferences.md b/Docs/4_Preferences.md
deleted file mode 100644
index e9227f5..0000000
--- a/Docs/4_Preferences.md
+++ /dev/null
@@ -1,212 +0,0 @@
-
-
-> **Note**: These docs have moved to [courier.com/docs/sdk-libraries/react-native](https://www.courier.com/docs/sdk-libraries/react-native/). The content below may be outdated.
-
-# Courier Preferences
-
-In-app notification settings that allow your users to customize which of your notifications they receive. Allows you to build high quality, flexible preference settings very quickly.
-
-## Requirements
-
-
-
-
- | Requirement |
- Reason |
-
-
-
-
-
-
- Authentication
-
- |
-
- Needed to view preferences that belong to a user.
- |
-
-
-
-
-
-
-## Default Preferences View
-
-The default `CourierPreferencesView` styles.
-
-
-
-
-```javascript
-import { CourierPreferencesView } from '@trycourier/courier-react-native';
-
-
-```
-
-
-
-## Styled Preferences View
-
-The styles you can use to quickly customize the `CourierPreferencesView`.
-
-
-
-
-```javascript
-import { CourierPreferencesView } from '@trycourier/courier-react-native';
-
-const styles = {
- Fonts: {
- heading: Platform.OS === 'ios' ? 'Avenir Medium' : 'fonts/poppins_regular.otf',
- title: Platform.OS === 'ios' ? 'Avenir Medium' : 'fonts/poppins_regular.otf',
- subtitle: Platform.OS === 'ios' ? 'Avenir Medium' : 'fonts/poppins_regular.otf'
- },
- Colors: {
- heading: isDark ? '#9747FF' : '#9747FF',
- title: isDark ? '#FFFFFF' : '#000000',
- subtitle: isDark ? '#9A9A9A' : '#BEBEBE',
- option: isDark ? '#1F1F1F' : '#F0F0F0',
- action: isDark ? '#9747FF' : '#9747FF',
- },
- TextSizes: {
- heading: 24,
- title: 18,
- subtitle: 16,
- },
- Corners: {
- button: 100
- }
-}
-
-const theme = {
- brandId: 'ASDFASDF',
- sectionTitleFont: {
- family: styles.Fonts.heading,
- size: styles.TextSizes.heading,
- color: styles.Colors.heading
- },
- topicTitleFont: {
- family: styles.Fonts.title,
- size: styles.TextSizes.title,
- color: styles.Colors.title
- },
- topicSubtitleFont: {
- family: styles.Fonts.subtitle,
- size: styles.TextSizes.subtitle,
- color: styles.Colors.subtitle
- },
- topicButton: {
- font: {
- family: styles.Fonts.subtitle,
- size: styles.TextSizes.subtitle,
- color: styles.Colors.title
- },
- backgroundColor: styles.Colors.option,
- cornerRadius: styles.Corners.button
- },
- sheetTitleFont: {
- family: styles.Fonts.heading,
- size: styles.TextSizes.heading,
- color: styles.Colors.heading
- },
- infoViewStyle: {
- font: {
- family: styles.Fonts.title,
- size: styles.TextSizes.title,
- color: styles.Colors.title
- },
- button: {
- font: {
- family: styles.Fonts.subtitle,
- size: styles.TextSizes.subtitle,
- color: styles.Colors.action
- },
- backgroundColor: styles.Colors.title,
- cornerRadius: styles.Corners.button
- }
- },
- iOS: {
- topicCellStyles: {
- separatorStyle: 'none'
- },
- sheetSettingStyles: {
- font: {
- family: styles.Fonts.title,
- size: styles.TextSizes.title,
- color: styles.Colors.title
- },
- toggleColor: styles.Colors.action
- },
- sheetCornerRadius: 20,
- sheetCellStyles: {
- separatorStyle: 'none'
- }
- },
- android: {
- topicDividerItemDecoration: 'vertical',
- sheetDividerItemDecoration: 'vertical',
- sheetSettingStyles: {
- font: {
- family: styles.Fonts.title,
- size: styles.TextSizes.title,
- color: styles.Colors.title
- },
- toggleThumbColor: styles.Colors.action,
- toggleTrackColor: styles.Colors.option,
- }
- }
-}
-
- {
- console.log(`Preferences scroll offset y: ${y}`);
- }}
- onPreferenceError={(error) => {
- console.log(error)
- }}
- style={...}
- />
-```
-
-### Courier Studio Branding (Optional)
-
-
-
-You can control your branding from the [`Courier Studio`](https://app.courier.com/designer/brands).
-
-
-
-
- | Supported Brand Styles |
- Support |
-
-
-
-
- Primary Color |
- ✅ |
-
-
- Show/Hide Courier Footer |
- ✅ |
-
-
-
-
----
-
-👋 `Branding APIs` can be found here
-
-👋 `Preference APIs` can be found here
diff --git a/Docs/5_Client.md b/Docs/5_Client.md
deleted file mode 100644
index 560ce16..0000000
--- a/Docs/5_Client.md
+++ /dev/null
@@ -1,134 +0,0 @@
-> **Note**: These docs have moved to [courier.com/docs/sdk-libraries/react-native](https://www.courier.com/docs/sdk-libraries/react-native/). The content below may be outdated.
-
-# `CourierClient`
-
-Base layer Courier API wrapper.
-
-## Initialization
-
-Creating a client stores request authentication credentials only for that specific client. You can create as many clients as you'd like. See the "Going to Production" section here for more info.
-
-```typescript
-// Creating a client
-const client = new CourierClient({
- userId: "...", // Optional. Likely needed for your use case. See above for more authentication details
- showLogs: "...", // Optional. Defaults to your current BuildConfig
- jwt: "your_user_id",
- clientKey: "...", // Optional. Used only for Inbox
- tenantId: .., // Optional. Used for scoping a client to a specific tenant
- connectionId: "...", // Optional. Used for inbox websocket
- apiUrls: getCourierApiUrlsForRegion("eu"), // Optional. Use for EU-hosted workspaces
-});
-
-// Details about the client
-const options = client.options;
-
-// Remove the api client
-client.remove();
-```
-
-## Token Management APIs
-
-All available APIs for Token Management
-
-```typescript
-// To customize the device of the token being saved
-// You do not need this
-const device = {
- appId: "...", // Optional
- adId: "...", // Optional
- deviceId: "...", // Optional
- platform: "...", // Optional
- manufacturer: "...", // Optional
- model: "...", // Optional
-}
-
-await client.tokens.putUserToken({
- token: "...",
- provider: "firebase-fcm",
- device: device // Optional
-)
-
-// Deletes the token from Courier Token Management
-await client.tokens.deleteUserToken({
- token: "..."
-})
-```
-
-## Inbox APIs
-
-All available APIs for Inbox
-
-```typescript
-// Get all inbox messages
-// Includes the total count in the response
-const messages = await client.inbox.getMessages({
- paginationLimit: 123, // Optional
- startCursor: undefined, // Optional
-});
-
-// Returns only archived messages
-// Includes the total count of archived message in the response
-const archivedMessages = await client.inbox.getArchivedMessages({
- paginationLimit: 123, // Optional
- startCursor: undefined, // Optional
-});
-
-// Gets the number of unread messages
-const unreadCount = await client.inbox.getUnreadMessageCount();
-
-// Tracking messages
-await client.inbox.open({ messageId: "..." });
-await client.inbox.read({ messageId: "..." });
-await client.inbox.unread({ messageId: "..." });
-await client.inbox.archive({ messageId: "..." });
-await client.inbox.readAll();
-```
-
-## Preferences APIs
-
-All available APIs for Preferences
-
-```typescript
-// Get all the available preference topics
-const preferences = await client.preferences.getUserPreferences({
- paginationCursor: undefined // Optional
-});
-
-// Gets a specific preference topic
-const topic = await client.preferences.getUserPreferenceTopic({
- topicId: "..."
-});
-
-// Updates a user preference topic
-await client.preferences.putUserPreferenceTopic({
- topicId: "...",
- status: CourierUserPreferencesStatus.OptedIn,
- hasCustomRouting: true,
- customRouting: [CourierUserPreferencesChannel.DirectMessage]
-});
-```
-
-## Branding APIs
-
-All available APIs for Branding
-
-```typescript
-const brandRes = await client.brands.getBrand({
- brandId: "..."
-});
-```
-
-## URL Tracking APIs
-
-All available APIs for URL Tracking
-
-```swift
-// Pass a trackingUrl, usually found inside of a push notification payload or Inbox message
-// Tell which event happened.
-// All available events: .clicked, .delivered, .opened, .read, .unread
-await client.tracking.postTrackingUrl({
- url: "courier_tracking_url",
- event: CourierTrackingEvent.Clicked
-});
-```
diff --git a/Docs/6_Expo.md b/Docs/6_Expo.md
deleted file mode 100644
index c1c959e..0000000
--- a/Docs/6_Expo.md
+++ /dev/null
@@ -1,336 +0,0 @@
-> **Note**: These docs have moved to [courier.com/docs/sdk-libraries/react-native](https://www.courier.com/docs/sdk-libraries/react-native/). The content below may be outdated.
-
-# Expo
-
-This is how to using `CourierReactNative` in an Expo app.
-
-
-
-# iOS
-
-## Push Notifications
-
-If you want to automatically sync [`Push Notification`](https://github.com/trycourier/courier-react-native/blob/master/Docs/3_PushNotifications.md) tokens you will need to update your `AppDelegate` files.
-
-
-
-Swift
-
-### 1. Add this file to your iOS Project
-
-```swift
-import UIKit
-import UserNotifications
-import Courier_iOS
-import React
-
-@objc class CourierExpoDelegate: NSObject, UNUserNotificationCenterDelegate {
-
- private var notificationPresentationOptions: UNNotificationPresentationOptions = []
- private var cachedMessage: [AnyHashable: Any]?
- private var isReactNativeReady = false
-
- private let courierForegroundOptionsDidChangeNotification = Notification.Name("iosForegroundNotificationPresentationOptions")
-
- override init() {
- super.init()
-
- // Set the user agent
- Courier.agent = CourierAgent.reactNativeExpoIOS("5.6.7")
-
- // Register for remote notifications
- UIApplication.shared.registerForRemoteNotifications()
-
- // Set notification center delegate
- UNUserNotificationCenter.current().delegate = self
-
- // Observe notifications
- NotificationCenter.default.addObserver(
- self,
- selector: #selector(notificationPresentationOptionsUpdate(_:)),
- name: courierForegroundOptionsDidChangeNotification,
- object: nil
- )
-
- NotificationCenter.default.addObserver(
- self,
- selector: #selector(onBridgeWillReload),
- name: NSNotification.Name.RCTBridgeWillReload,
- object: nil
- )
-
- NotificationCenter.default.addObserver(
- self,
- selector: #selector(onReactNativeReady(_:)),
- name: NSNotification.Name.RCTContentDidAppear,
- object: nil
- )
- }
-
- // MARK: - React Native lifecycle
-
- /// Called when React Native is loaded and ready
- @objc private func onReactNativeReady(_ note: Notification) {
- isReactNativeReady = true
-
- // Flush any cached message
- if let message = cachedMessage {
- NotificationCenter.default.post(
- name: Notification.Name("pushNotificationClicked"),
- object: nil,
- userInfo: message
- )
- cachedMessage = nil
- }
- }
-
- /// Called when there is a reload in React Native
- @objc private func onBridgeWillReload() {
- isReactNativeReady = false
- }
-
- // MARK: - Foreground options update
-
- @objc private func notificationPresentationOptionsUpdate(_ notification: Notification) {
- if let userInfo = notification.userInfo,
- let options = userInfo["options"] as? NSNumber {
- notificationPresentationOptions = UNNotificationPresentationOptions(rawValue: options.uintValue)
- }
- }
-
- // MARK: - UNUserNotificationCenterDelegate
-
- /// User tapped on a notification
- func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
- let content = response.notification.request.content
- let message = content.userInfo
-
- // Track click event
- Task {
- await message.trackMessage(event: .clicked)
- }
-
- let pushNotification = Courier.formatPushNotification(content: content)
-
- DispatchQueue.main.async { [weak self] in
- guard let self = self else { return }
- if self.isReactNativeReady {
- NotificationCenter.default.post(
- name: Notification.Name("pushNotificationClicked"),
- object: nil,
- userInfo: pushNotification
- )
- } else {
- self.cachedMessage = pushNotification
- }
- completionHandler()
- }
- }
-
- /// Notification delivered while app is in foreground
- func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
- let content = notification.request.content
- let message = content.userInfo
-
- // Track delivery event
- Task {
- await message.trackMessage(event: .delivered)
- }
-
- DispatchQueue.main.async { [weak self] in
- guard let self = self else { return }
- let pushNotification = Courier.formatPushNotification(content: content)
- NotificationCenter.default.post(
- name: Notification.Name("pushNotificationDelivered"),
- object: nil,
- userInfo: pushNotification
- )
- completionHandler(self.notificationPresentationOptions)
- }
- }
-
- // MARK: - Push Registration
-
- @objc func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
- print("[Courier] Failed to register for remote notifications: \(error.localizedDescription)")
- }
-
- @objc func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
- Task { @CourierActor in
- Courier.setAPNSToken(deviceToken)
- }
- }
-
- deinit {
- cachedMessage = nil
- isReactNativeReady = false
- NotificationCenter.default.removeObserver(self)
- }
-}
-```
-
-### 2. Update your `AppDelegate.swift` to add these lines
-
-```swift
-@UIApplicationMain
-public class AppDelegate: ExpoAppDelegate {
-
- ..
-
- // == ADD THIS LINE ==
- private let courierExpoDelegate = CourierExpoDelegate()
-
- ..
-
- // == ADD THIS LINE ==
- public override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
- courierExpoDelegate.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
- }
-
-}
-```
-
-
-
-
-
-Objective C
-
-
-
-`AppDelegate.h`
-
-```objc
-#import
-#import
-#import
-#import
-
-@interface AppDelegate : EXAppDelegateWrapper
-
-// Add a property for the Courier delegate so we can forward calls
-@property (nonatomic, strong) CourierReactNativeDelegate *courierDelegate;
-
-@end
-```
-
-`AppDelegate.mm`
-
-```objc
-#import "AppDelegate.h"
-
-#import
-#import
-
-@implementation AppDelegate
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
-{
- self.moduleName = @"main";
- self.initialProps = @{};
-
- // Instantiate CourierReactNativeDelegate
- self.courierDelegate = [[CourierReactNativeDelegate alloc] init];
-
- return [super application:application didFinishLaunchingWithOptions:launchOptions];
-}
-
-#pragma mark - Push Notification Registration
-
-- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
-{
- // Forward to CourierReactNativeDelegate
- if ([self.courierDelegate respondsToSelector:@selector(application:didRegisterForRemoteNotificationsWithDeviceToken:)]) {
- [self.courierDelegate application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
- }
-
- // And call super to keep Expo / React Native happy
- [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
-}
-
-- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
-{
- // Forward to CourierReactNativeDelegate
- if ([self.courierDelegate respondsToSelector:@selector(application:didFailToRegisterForRemoteNotificationsWithError:)]) {
- [self.courierDelegate application:application didFailToRegisterForRemoteNotificationsWithError:error];
- }
-}
-
-#pragma mark - UNUserNotificationCenterDelegate
-
-// Called when a notification is delivered while the app is foregrounded
-- (void)userNotificationCenter:(UNUserNotificationCenter *)center
- willPresentNotification:(UNNotification *)notification
- withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
-{
- // Forward to CourierReactNativeDelegate
- if ([self.courierDelegate respondsToSelector:@selector(userNotificationCenter:willPresentNotification:withCompletionHandler:)]) {
- [self.courierDelegate userNotificationCenter:center
- willPresentNotification:notification
- withCompletionHandler:completionHandler];
- } else {
- // If the Courier delegate doesn't handle it, provide a default
- completionHandler(UNNotificationPresentationOptionNone);
- }
-}
-
-// Called when the user taps on a notification
-- (void)userNotificationCenter:(UNUserNotificationCenter *)center
-didReceiveNotificationResponse:(UNNotificationResponse *)response
- withCompletionHandler:(void (^)(void))completionHandler
-{
- // Forward to CourierReactNativeDelegate
- if ([self.courierDelegate respondsToSelector:@selector(userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:)]) {
- [self.courierDelegate userNotificationCenter:center
- didReceiveNotificationResponse:response
- withCompletionHandler:completionHandler];
- } else {
- completionHandler();
- }
-}
-
-..
-
-@end
-```
-
-
-
-# Android
-
-You must extend your `MainActivity` with `CourierReactNativeActivity`
-
-Kotlin
-```kotlin
-import com.courierreactnative.CourierReactNativeActivity;
-
-class MainActivity : CourierReactNativeActivity() {
- ..
-}
-```
-
-## Inbox
-
-Because Courier Inbox uses Android's Material theme and your app's styles as the default colors, you need to make sure your `styles.xml` theme parent extends `MaterialComponents`.
-
-In your `res/values/styles.xml` set the follow:
-
-```xml
-
-
-
-
-
-
-
-
-
-```
diff --git a/README.md b/README.md
index c517926..fd38893 100644
--- a/README.md
+++ b/README.md
@@ -1,192 +1,45 @@
-
# 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.
+Requires iOS 15.0+, Android SDK 23+, and Gradle 8.4+.
+
## Installation
```bash
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.
+Also available via `yarn add @trycourier/courier-react-native`. After installing, run `cd ios && pod install`.
## Quick Start
```jsx
-import Courier, {
- CourierInboxView,
- CourierPreferencesView,
-} from "@trycourier/courier-react-native";
+import Courier, { CourierInboxView } from "@trycourier/courier-react-native";
-// Sign in the user (JWT generated by your backend)
+// Sign in (JWT generated by your backend)
await Courier.shared.signIn({
userId: "user_123",
accessToken: jwt,
});
-// Add a prebuilt Inbox component
+// Drop in a prebuilt Inbox view
{
+ onClickInboxMessageAtIndex={(message) => {
message.read
? Courier.shared.unreadMessage({ messageId: message.messageId })
: Courier.shared.readMessage({ messageId: message.messageId });
}}
style={{ flex: 1 }}
/>
-
-// Add a prebuilt Preferences component
-
```
-For Expo projects, see the [Expo setup guide](https://github.com/trycourier/courier-react-native/blob/master/Docs/6_Expo.md).
-
## Documentation
-Full documentation: **[courier.com/docs/sdk-libraries/react-native](https://www.courier.com/docs/sdk-libraries/react-native/)**
-
-- [Inbox Overview](https://www.courier.com/docs/platform/inbox/inbox-overview/)
-- [Authentication](https://www.courier.com/docs/platform/inbox/authentication/)
-- [Push Integrations](https://www.courier.com/docs/external-integrations/push/intro-to-push/)
-
-
-
-
-# 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](https://www.courier.com/docs/sdk-libraries/react-native/#expo) for all the details.
+Full documentation lives at **[courier.com/docs/sdk-libraries/react-native](https://www.courier.com/docs/sdk-libraries/react-native)** — installation, authentication, push setup (iOS `CourierReactNativeDelegate` + Android Firebase decoupling), theming, custom UI, Expo, and the `CourierClient` API reference.
-
+## Feedback
-# 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!
-
-[Courier React Native Issues](https://github.com/trycourier/courier-react-native/issues)
-
-## EU endpoints
-
-If your workspace uses EU-hosted Courier endpoints, pass the built-in EU preset through `apiUrls`.
-
-```tsx
-import Courier, { getCourierApiUrlsForRegion } from "@trycourier/courier-react-native";
-
-await Courier.shared.signIn({
- userId: "your_user_id",
- accessToken: jwt,
- apiUrls: getCourierApiUrlsForRegion("eu")
-});
-```
+Found a bug or want to request a feature? [Open an issue](https://github.com/trycourier/courier-react-native/issues).