basefyio + React Native: Backend for Mobile Apps
React Native apps need a backend they can call directly. basefyio-js works in React Native to query the database, authenticate users, and upload files.
Install
npm install basefyio-jsCreate the client
// basefyio.ts
import { createClient } from "basefyio-js";
export const bf =createClient({
projectId: process.env.EXPO_PUBLIC_BASEFYIO_PROJECT_ID!,
apiKey: process.env.EXPO_PUBLIC_BASEFYIO_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 { bf } from "./basefyio";
await bf.auth.signIn({ email, password });
const { data } = await bf
.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 bf.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 basefyio-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 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 basefyio
database, auth, storage, and a REST API — running in minutes.