Skip to content

Area: Developers

Mobile SDKs overview

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.

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
React Native with Expo and expo-notifications same package, /expo adapter 0.4.3 Push notifications with Expo
iOS, Swift RelevaSDK (Swift Package Manager) 5.2.1 Connect your iOS app
Android, Kotlin com.github.Releva-ai:sdk-kotlin (JitPack) 1.8.0 Connect your Android app
Flutter releva_sdk (pub) 0.3.2 Connect your Flutter app

What changed in each release is in the integrations changelog.

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. 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. 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.
  4. Verify that token registrations and screen views arrive: 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.

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

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

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, How Releva connects to your shop
Paid orders placed outside the app, refunds Orders API overview
Profile attributes (e-mail, phone, name) and registrations Profiles API overview
Marketing consent Consent API 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.

API

  • Endpoints the Releva SDKs call

    The storefront and app endpoints the Releva JavaScript and mobile SDKs call, and the product blocks, banners and stories they receive in the page push, with the click, impression and event calls that report back. For teams that build their own client.

  • Inbox API overview

    The six endpoints a mobile app uses to read a shopper's App Inbox: authentication with the access token, the userId rule, pagination, read and delete semantics, errors and limits, with a working request for each.

  • Surveys and NPS API

    The three public endpoints behind Releva's hosted survey page and the NPS widget, the nps object in the page push, the SDK functions, limits and every error message, with a working request for each.

  • Catalog API overview

    The catalog calls, one page each, and the authentication, request format, responses and limits they share.

  • Profiles API overview

    The profile calls of the Releva API, one page each (create or update, get, delete, export, register, the subscriber sync and the loyalty link), plus how profiles are identified.

  • Orders and refunds API overview

    The order calls, one page each, and the authentication, request format, responses and limits they share.

  • Consent API overview

    The consent and subscription calls of the Releva API, one page each - subscribe from your server or the browser, double opt-in, unsubscribe, unsubscribe links and one-click, and consent history.