Back to Skills

api-routes

Guidelines for creating API routes in Expo Router with EAS Hosting

180stars7forksUpdated 1/16/2026

Security Assessment

Medium Risk(65/100)

Detected risks:

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

About api-routes

The 'api-routes' skill provides comprehensive guidelines for creating API routes using Expo Router in conjunction with EAS Hosting. It addresses the need for secure server-side operations, enabling developers to implement functionality that requires hidden secrets, such as API keys and database credentials. This skill helps in maintaining the integrity and security of applications by ensuring sensitive information does not reach the client-side while facilitating critical operations like database queries, server-side validation, and interactions with third-party APIs.

FAQ

When should I use API routes?

Use API routes when you need to handle server-side secrets, perform database operations, validate data, or interact with third-party services securely.

Can I use API routes for real-time updates?

No, for real-time updates, consider using WebSockets or services like Supabase Realtime instead.

What is the file structure for API routes?

API routes should be placed in the 'app' directory with a '+api.ts' suffix, e.g., app/api/hello+api.ts.

How do I handle CORS for web clients?

You can add CORS headers in your API route responses to allow access from web clients.

What should I do if I need to upload files?

For file uploads, use direct-to-storage solutions such as S3 presigned URLs or Cloudflare R2.

Install 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