# Scribase for Expo and React Native apps

> Scribase for Expo: the JavaScript client with AsyncStorage or SecureStore, Apple and Google sign-in via PKCE, storage for uploads, and realtime on Postgres.

Source: https://scribase.com/for/expo-backend

Mobile apps need auth that survives app restarts, uploads from the camera roll, and a backend that does not charge per read. Expo apps already use a standard JavaScript client; point it at Scribase and you get the same session handling, Apple and Google sign-in over PKCE, and storage uploads, backed by Postgres with row-level security.

## What this audience is building

- Persistent sessions on device and Apple/Google sign-in
- Uploads from the device with per-user access rules
- A backend bill that does not grow with every screen view

## How Scribase meets each need

**The JavaScript client on React Native** — Create the client with an AsyncStorage (or SecureStore) adapter and autoRefreshToken on. Sessions persist across restarts and refresh in the background.

**Apple and Google sign-in** — signInWithOAuth with flowType pkce and skipBrowserRedirect gives you the provider URL; open it with expo-web-browser, then exchangeCodeForSession with the code from your app scheme redirect. The auth server runs the PKCE exchange, so no client secret ships in the app.

**Storage with RLS** — Upload from the image picker to a private bucket and scope objects by user id with a storage policy, so users only read their own files.

_# lib/scribase.ts in an Expo app_

```
import AsyncStorage from '@react-native-async-storage/async-storage';
import { createClient } from '@supabase/supabase-js';

export const scribase = createClient(process.env.EXPO_PUBLIC_SCRIBASE_URL!, process.env.EXPO_PUBLIC_SCRIBASE_ANON_KEY!, {
  auth: { storage: AsyncStorage, autoRefreshToken: true, persistSession: true, detectSessionInUrl: false },
});
```

## FAQ

**Is there offline-first sync like Firestore?**

No. Scribase provides realtime subscriptions and standard queries; offline-first sync is not built in yet.

**Can I move an existing Firebase Auth user base?**

Yes. The Firebase importer carries users, linked providers, and scrypt password hashes, and the auth server verifies them at sign-in and upgrades them to Argon2 on first login.

## Related

- [Mobile app backend use case](https://scribase.com/use-cases/mobile-app-backend)
- [Migrate from Firebase](https://scribase.com/migrate/firebase)
- [Pricing](https://scribase.com/pricing)