# Mobile SDKs overview

> Which Releva SDK to use for React Native, Expo, iOS, Android and Flutter apps, the four things you set up in the Releva admin, what every SDK sends to Releva and what still has to come from your backend.

A mobile app talks to Releva through one of the mobile SDKs. The SDK tracks what the shopper does, fetches the product blocks, banners, stories and surveys configured for each screen, registers the device for app push and reads the App Inbox. Your backend still sends the catalog, paid orders, refunds, profile data and marketing consent through the server APIs.

This page is the map. Each platform has its own setup page with the code.

## Pick your SDK

| App stack                                        | SDK                                         | Latest release | Setup page                                                                                               |
| ------------------------------------------------ | ------------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------- |
| React Native with Firebase messaging and notifee | `@releva-ai/sdk-react-native`               | 0.4.3          | [Connect your React Native app](https://releva.ai/documentation/integrations/react-native/connect-your-react-native-app/) |
| React Native with Expo and `expo-notifications`  | same package, `/expo` adapter               | 0.4.3          | [Push notifications with Expo](https://releva.ai/documentation/integrations/react-native/push-notifications-with-expo/)   |
| iOS, Swift                                       | `RelevaSDK` (Swift Package Manager)         | 5.2.1          | [Connect your iOS app](https://releva.ai/documentation/integrations/ios-swift/connect-your-ios-app/)                      |
| Android, Kotlin                                  | `com.github.Releva-ai:sdk-kotlin` (JitPack) | 1.8.0          | [Connect your Android app](https://releva.ai/documentation/integrations/android-kotlin/connect-your-android-app/)         |
| Flutter                                          | `releva_sdk` (pub)                          | 0.3.2          | [Connect your Flutter app](https://releva.ai/documentation/integrations/flutter/connect-your-flutter-app/)                |

What changed in each release is in the [integrations changelog](https://releva.ai/documentation/changelog/integrations/).

## Four things to set up in the Releva admin

None of them is on a mobile-specific screen. There is no “mobile app” platform, connector or switch in the admin; the shop’s **Platform** stays whatever your web shop is.

1. **Access Token.** The SDK client takes it as its second argument (`new RelevaClient('', '<accessToken>')`). Copy it from **Settings › Shop & Integration › General**: [Find your Access Token and Secret Key](https://releva.ai/documentation/guides/shop-settings/find-your-api-keys/). The access token is a public key and ships inside the app. Never put the **Secret Key** in an app.
2. **Page tokens.** Every screen that should record a page view, or receive product blocks, banners and stories, sends the token of a Releva page as its `screenToken`. Pages and their tokens live on **Personalization › Product Blocks**, in the **Token:** bar under the page selector: [Pages and tokens](https://releva.ai/documentation/learn/product-blocks/how-product-blocks-work/#pages-and-tokens). A screen sent without a token, or with a value Releva does not know, is accepted with `200` but records nothing and gets no blocks. Names you make up, such as `home_screen`, are not tokens.
3. **Firebase credentials**, only for app push and App Inbox. Upload the Firebase service account on **Settings › Messaging › Push Notifications**: [Add your Firebase credentials for app push](https://releva.ai/documentation/integrations/mobile/add-firebase-credentials-for-app-push/).
4. **Verify** that token registrations and screen views arrive: [Check that your mobile app is connected](https://releva.ai/documentation/integrations/mobile/check-that-your-mobile-app-is-connected/).

`realm` is the client’s first argument. Leave it `''`: the SDK then calls `https://releva.ai`. A non-empty realm becomes `https://<realm>.releva.ai`. The admin shows no realm; use one only if Releva gives you one.

## What every SDK sends

All calls go to `https://releva.ai/api/v0` with `authorization: Bearer <accessToken>` and `content-type: application/json`. The SDKs identify the shopper by `deviceId` and `profileId` only. **They never send an e-mail address, phone number, name or consent.**

| Data                                                                                 | Endpoint                                                                                                             | When                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Screen, product and search views, custom events, cart and wishlist changes, checkout | `POST /push`                                                                                                         | On every `track*` call. The response carries the product blocks, banners, stories and NPS surveys for the screen. `setCart` and `setWishlist` store on the first call and send a push on later changes. `trackCheckoutSuccess` sends the paid cart, then clears the stored cart.                                                                                                                            |
| App push token                                                                       | `POST /appPush/tokens`                                                                                               | When the app calls `registerPushToken`; the Swift SDK also re-registers on every foreground and profile change when `pushTokenProvider` is set. Each call writes a **Push Notification Subscribe** event and creates a placeholder profile if the profile id is new. Reference: [Register a mobile app push token](https://releva.ai/documentation/reference/push-notifications/overview/#register-a-mobile-app-push-token). |
| Push tap (click tracking)                                                            | `GET` of the push’s `callbackUrl`                                                                                    | When the shopper taps a Releva push.                                                                                                                                                                                                                                                                                                                                                                        |
| Banner impressions, banner and story actions                                         | `POST /impressions`, `POST /push/events`                                                                             | When a banner is shown, tapped or closed, and on story interactions.                                                                                                                                                                                                                                                                                                                                        |
| NPS answer                                                                           | `POST /nps/{token}/submissions`                                                                                      | When the shopper submits a survey.                                                                                                                                                                                                                                                                                                                                                                          |
| App Inbox                                                                            | `GET /inbox/messages`, `GET /inbox/unread-count`, `POST …/read`, `POST …/read-all`, `DELETE …/{id}`, `POST …/action` | After `initializeInbox()`, on a silent sync push and on resume when the cache is older than 5 minutes. Reference: [Inbox API overview](https://releva.ai/documentation/reference/inbox/overview/).                                                                                                                                                                                                                           |

Only tokens registered as `android` or `ios` ever receive a push. `huawei` and `other` are accepted and stored but never targeted.

## What your backend still sends

The app covers what the shopper does on the device. Everything else goes through the server APIs with the **Secret Key**:

| Data                                                       | Reference                                                                                                                                                                                                                                                                 |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Products, and the full-catalog pull sync as a safety net   | [Catalog API overview](https://releva.ai/documentation/reference/catalog/overview/), [How Releva connects to your shop](https://releva.ai/documentation/learn/shop-settings/how-releva-connects-to-your-shop/)                                                                                              |
| Paid orders placed outside the app, refunds                | [Orders API overview](https://releva.ai/documentation/reference/orders/overview/)                                                                                                                                                                                                          |
| Profile attributes (e-mail, phone, name) and registrations | [Profiles API overview](https://releva.ai/documentation/reference/profiles/overview/)                                                                                                                                                                                                      |
| Marketing consent                                          | [Consent API overview](https://releva.ai/documentation/reference/consent/overview/). A token registration is not a consent decision: a new profile created by one has no consent, and an existing profile’s consent is not changed. The OS notification permission is the opt-in for push. |

## Next steps

* [How push notifications work](https://releva.ai/documentation/learn/push-notifications/how-push-notifications-work/): Learn how an app opts in and what the delivery options do.
* [How the App Inbox works](https://releva.ai/documentation/learn/inbox/how-the-app-inbox-works/): Learn how inbox messages reach your app and stay in sync.
* [Push notifications API overview](https://releva.ai/documentation/reference/push-notifications/overview/): Register an app push token and see what a delivered push contains.
* [How product blocks work](https://releva.ai/documentation/learn/product-blocks/how-product-blocks-work/): See how recommendations are chosen and shown in your app.