Agent skill · software engineering · aiskillstore

expo-api-routes

Guidelines for creating API routes in Expo Router with EAS Hosting

Why this skill is useful

Provides specific patterns and examples for creating API routes in Expo Router that the AI wouldn't reliably generate on its own.

What it needs

Requires expo-cli installed locally. About 5k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

When to Use API Routes Use API routes when you need: Server-side secrets — API keys, database credentials, or tokens that must never reach the client Database operations — Direct database queries that shouldn't be exposed Third-party API proxies — Hide API keys when calling external services (OpenAI, Stripe, etc.) Server-side validation — Validate data before database writes Webhook endpoints — Receive callbacks from services like Stripe or GitHub Rate limiting — Control access at the server level Heavy computation — Offload processing that would be slow on mobile When NOT to Use API Routes Avoid API routes when: Data is already public — Use direct fetch to public APIs instead No secrets required — Static data or client-safe operations Real-time updates needed — Use WebSockets or services like Supabase Realtime Simple CRUD — Consider Firebase, Supabase, or Convex for managed backends File uploads — Use direct-to-storage uploads (S3 presigned URLs, Cloudflare R2) Authentication only — Use Clerk, Auth0, or Firebase Auth instead File Structure API routes live in the app directory with +api.ts suffix: Basic API Route HTTP Methods Export named functions for each HTTP method: Dynamic Routes Request Handling Query Parameters Headers JSON Body Environment Variables Use process.env for server-side secrets: Set environment variables: Local: Create .env file (never commit) EAS Hosting: Use eas env:create or Expo dashboard CORS Headers Add CORS for web clients: Error Handling Testing Locally Start the development server with API routes: This starts a local server at http://localhost:8081 with full API route support. Test with curl: Deployment to EAS Hosting Prerequisites Deploy This builds and deploys your API routes to EAS Hosting (Cloudflare Workers). Environment Variables for Production Custom Domain Configure in eas.json or Expo dashboard. EAS Hosting Runtime (Cloudflare Workers) API routes run on Cloudflare Workers. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/expo-api-routes

View the source on GitHub

Browse the @skills marketplace