Kolaybase + React Native: Backend for Mobile Apps
React Native apps need a backend they can call directly. kolaybase-js works in React Native to query PostgreSQL, authenticate users, and upload files.
Install
npm install kolaybase-jsCreate the client
// kolaybase.ts
import { createClient } from "kolaybase-js";
export const kb = createClient({
projectId: process.env.EXPO_PUBLIC_KOLAYBASE_PROJECT_ID!,
apiKey: process.env.EXPO_PUBLIC_KOLAYBASE_ANON_KEY!,
});With Expo, use EXPO_PUBLIC_ env variables for the anon key. Secure user data with row-level security so the mobile client only sees permitted rows.
Sign in and load data
import { kb } from "./kolaybase";
await kb.auth.signIn({ email, password });
const { data } = await kb
.from("messages")
.select("id, body, sent_at")
.order("sent_at", { ascending: true });Direct, serverless calls
Your app talks to the backend over plain HTTP/JSON — no server to maintain per screen.
Auth built in
Email, OAuth, and magic-link sign-in via kb.auth, with sessions handled for you.
Files with signed URLs
Upload media to S3-compatible storage and serve it with access-controlled URLs.
Frequently asked questions
- Does kolaybase-js work in React Native and Expo?
- Yes. It's a standard JavaScript SDK using fetch, so it runs in React Native and Expo. Use public env variables for the anon key.
- How is mobile data kept secure?
- Authentication plus PostgreSQL row-level security means even direct API calls only return rows the signed-in user is allowed to access.
Other integrations
Build your React Native backend on Kolaybase
PostgreSQL, auth, storage, and a REST API — running in minutes.