Backend · Backend code in the same repo

Expo + API routes

API routes in an Expo SDK 57 app for iOS and Android, wired by one command and checked by doctor.

This turns on Expo Router's server routes so your app has a backend in the same tree: src/app/api/health+api.ts answers GET /api/health with { ok, version, variant }, src/app/api/echo+api.ts answers POST /api/echo { message } with zod validation and a 400 on bad input, and src/server/ holds the pieces you'll reuse - json.ts (json(), error(), readJson(request, schema), handle() which maps BadRequest to 4xx and anything else to 500 without leaking a stack), env.ts (serverEnv(), zod over process.env for keys that must never be EXPO_PUBLIC_), and webhooks/README.md with the handler pattern. If you set up with --with-examples there's an example at /examples/api. Pick this when a module needs a server - auth/better-auth requires it and payments/stripe wants it - or when you'd rather not stand up a separate backend yet.

When to pick API routes

Pick API routes when a module needs a server (auth/better-auth requires it, payments/stripe wants it for Checkout and webhooks) or when you'd rather write one endpoint than stand up a separate service.

At a glance

Runs in Expo Go
Yes
Files added
14
npm packages
0
Keys to paste
EXPO_PUBLIC_API_URL
Included in
Pro
Tests included
2

Set it up

bun run setup --backend api-routes

Setup copies the module in, installs SDK-matched versions and removes the options you did not pick. Then bun run doctor lists every key still missing, with a link to where you get it. The step-by-step guide is in the API routes docs.

Questions

Can I use API routes in Expo Go?

Yes. This module runs in Expo Go, so you can try it before you make a development build.

What do I need to set up API routes in an Expo app?

Run bun run setup --backend api-routes, then paste one key into .env: EXPO_PUBLIC_API_URL. bun run doctor lists any that are missing, with a link to where you get each one.

Does the ReadyNative free tier include API routes?

No. Backend is a Pro category: the free tier and Starter ship it switched off. Pro is one payment with lifetime updates.

Can I build the app without API routes?

Yes. Pick none for backend (bun run setup --backend none) - no src/app/api.

Get it

API routes ships in Pro: one payment, lifetime updates. See pricing or browse every module.