Mobile
Give your phone app the same sign-in, saved data, files, credits and AI tools
as your web app. Use @gemmein/sdk/expo for Expo and React Native, or the
GemmeinSwift package for Apple platforms.
import { createExpoGemmein } from "@gemmein/sdk/expo"
import { AppState, Platform } from "react-native"
export const g = createExpoGemmein({ appKey: "pk_live_..." }, { AppState, Platform })
await g.auth.sendEmailCode(email)
await g.auth.verifyEmailCode({ email, code })
const { records } = await g.collection("notes").list({ limit: 20 })
const me = await g.auth.currentUser()
if (me.authenticated && me.storeAccountToken) {
// RevenueCat must know the buyer by this name
await Purchases.configure({ apiKey: RC_KEY, appUserID: me.storeAccountToken })
// already configured? Purchases.logIn(me.storeAccountToken)
}
What it is. The same Gemmein API from an Expo app or a Swift app. Expo uses
@gemmein/sdk/expo, the same npm package with a second entry point. Swift
uses GemmeinSwift (iOS 17+ and macOS 14+), with the same method
names.
Does. Sign-in with an emailed sign-in code; your app's collections, private
records included; sealed files and files.link; credits; AI tools; the
store account token (currentUser().storeAccountToken), the name you
give RevenueCat as its app user id; sign out
everywhere for a stolen phone; and secure persistence (the iOS Keychain and the
Android Keystore through expo-secure-store, the Keychain through
KeychainTokenStore in Swift), so the app relaunches still signed in.
Does not. Offer Google or Apple sign-in: sign-in codes are the only way to sign in, on every platform. Hold store billing: a store purchase reaches Gemmein through RevenueCat's webhook into a relay. Broadcast: one event acts on one person.
Needs something else when. The person buys a store product → RevenueCat
and the three relay templates in Store purchases. They
buy on the web, or the goods are not the store's → Stripe,
the built-in path. Your app needs more sign-in codes than the limits allow → see
Sign-in limits. The device cannot keep the session
→ sign-in throws secure_store_unavailable; the fix is in
Codes.
Example. The Expo code above signs a person in, reads a private collection and gives RevenueCat the store account token. Swift shows the same three calls.
In this section
Expo, Swift and local development
Keys and sessions on a phone, Expo and React Native, Swift, the store account token, and gemmein dev.
Store purchases
App Store and Play purchases through RevenueCat and a relay.
Sign-in limits, billing and codes
Sign-in limits on a phone, sign out everywhere, billing, and the codes a mobile build meets.
Thanks for telling us.
Thanks for telling us.
Last updated