expo-api-routes

Implement serverless API routes in Expo Router using the +api.ts convention.

2.4k|125|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/expo/skills --skill expo-api-routes-expo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expo-api-routes
Source: https://github.com/expo/skills/tree/main/plugins/expo-app-design/skills/expo-api-routes
Command: npx skills add https://github.com/expo/skills --skill expo-api-routes-expo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance on creating and deploying serverless API routes within an Expo Router application, enabling developers to handle backend logic, manage secrets, and interact with databases directly from their Expo project.

Core Features & Use Cases

  • Server-Side Logic: Implement secure backend functionalities like data validation, database operations, and proxying external APIs.
  • Secret Management: Securely store and access API keys and sensitive credentials using environment variables.
  • Deployment: Deploy API routes seamlessly to EAS Hosting (Cloudflare Workers).
  • Use Case: Securely handle user authentication, process payments using Stripe webhooks, or fetch data from a private database without exposing sensitive information to the client.

Quick Start

Use the expo-api-routes skill to create a basic GET API route in your Expo Router app.

Frequently Asked Questions about expo-api-routes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create serverless API routes in an Expo Router application?

Create serverless API routes in Expo Router by adding a `+api.ts` file to your project. This convention allows you to handle HTTP methods, parse requests, and execute backend logic directly within your app structure.

Can I use Node.js APIs in Expo API routes deployed to EAS Hosting?

No, you cannot use Node.js APIs in Expo API routes deployed to EAS Hosting. Because the deployment environment uses Cloudflare Workers, you must use standard Web APIs and cloud databases instead of Node-specific modules.

How do I securely manage environment variables and secrets for my Expo API routes?

Securely manage environment variables for Expo API routes by configuring secrets in your deployment settings. This allows your serverless functions to access API keys and sensitive credentials without exposing them to the client side.

What backend logic can I handle using the `+api.ts` convention in Expo?

Using the `+api.ts` convention in Expo, you can implement backend logic like data validation, database operations, handling Stripe webhooks, user authentication, and proxying external APIs securely.

Does Expo Router support handling dynamic routes and CORS for serverless functions?

Yes, Expo Router supports dynamic routes and CORS for serverless functions. You can handle dynamic route parameters, configure CORS headers, and manage error handling within your `+api.ts` files.

What are the limitations of using Cloudflare Workers for Expo serverless API routes?

The main limitation of using Cloudflare Workers for Expo API routes is the runtime environment. You cannot rely on Node.js built-in modules or local file system access, meaning you must use Web APIs and cloud-based databases.