Back to Skills

expo-api-routes

Guidelines for creating API routes in Expo Router with EAS Hosting

1,672stars75forksUpdated 4/12/2026

Security Assessment

Medium Risk(65/100)

Detected risks:

Secret Exposure([SKILL.md] token =)
Sensitive File Access([SKILL.md] .env)
Security Score65/100

About expo-api-routes

The expo-api-routes skill provides guidelines for creating API routes in Expo Router with EAS Hosting. It is designed to help developers build and manage server-side routes within the Expo framework, allowing the use of API routes to handle tasks that require server-side logic. This includes managing secrets, database operations, third-party API calls, and other server-side functionalities that should not be exposed to the client. The skill solves the problem of securely managing sensitive data and performing operations like validation or heavy computation that should not be handled on the client-side.

FAQ

What is the purpose of using API routes in Expo?

API routes are used when you need to handle server-side operations such as managing secrets, performing database operations, validating data, or calling external APIs. They help keep sensitive logic secure and off the client-side.

Can I use API routes for real-time updates?

No, API routes are not ideal for real-time updates. For such use cases, WebSockets or services like Supabase Realtime are recommended.

What should I avoid using API routes for?

Avoid using API routes for public data, simple CRUD operations (consider managed backends like Firebase), file uploads, or authentication, as other services like Firebase Auth or S3 presigned URLs are more suitable.

How do I handle environment variables in Expo API routes?

You can use environment variables by referencing them through `process.env`, such as for API keys or secrets. They should be set in a `.env` file for local development or using `eas env:create` in Expo Hosting.

What are the file naming conventions for API routes in Expo?

API routes should be placed in the `app/api/` directory with a `+api.ts` suffix. For example, `hello+api.ts` for the route `/api/hello`.

Install expo-api-routes

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

expo/skills