Prompt
I'm building a mobile app and need secure APIs without running servers
Latest observation
Nov 4, 2026
OpenAI APIWeb search: off
If you want secure APIs without running your own servers, the usual path is to use Backend-as-a-Service (BaaS) or serverless APIs. They give you hosted auth, database, storage, and API endpoints with managed security.
Good options
- Firebase: Auth, Firestore, Storage, Functions, App Check, security rules
- Supabase: Postgres, Auth, Storage, Edge Functions, Row Level Security
- Appwrite: Auth, database, storage, functions
- AWS Amplify: Auth, AppSync, Lambda, DynamoDB, API Gateway
- PocketBase: lightweight, but typically you still host it somewhere
Best security patterns
-
Use managed authentication
- Email/password, OAuth, magic links, social login
- Prefer short-lived tokens
- Support refresh tokens where appropriate
-
Never trust the mobile app
- Treat the app as public/untrusted
- Enforce authorization on the backend or database layer
-
Use row-level or document-level security
- Supabase: Row Level Security policies
- Firestore: Security rules
- Appwrite: permissions/roles
-
Keep secrets out of the app
- Don’t embed admin keys, service role keys, or private API keys in the client
- Use only public/client-safe keys in the mobile app
-
Use serverless functions for privileged logic
- Payment verification
- Third-party API calls needing secret keys
- Admin actions
- Webhooks
-
Protect against abuse
- Rate limiting
- App attestation: Firebase App Check, Apple DeviceCheck/App Attest, Android Play Integrity
- CAPTCHA for suspicious flows
- Logging and monitoring
Recommended setups
If you want the simplest secure stack
Firebase
- Fastest for mobile
- Great auth and security rules
- Good if you want minimal backend work
If you want SQL and strong authorization control
Supabase
- Postgres + RLS is very strong
- Great for relational data
- Nice for APIs without custom servers
If you want more control over backend logic
AWS Amplify
- More flexible, more setup
- Good for larger apps
Example architecture
- Mobile app authenticates with Firebase Auth or Supabase Auth
- App reads/writes directly to Firestore or Postgres
- Security enforced by rules/RLS
- Sensitive operations go through serverless functions
- Use app attestation and rate limiting
Important warning
If by “without running servers” you mean no backend at all, that’s only safe for simple apps.
For anything involving:
- payments
- private data
- admin actions
- third-party secrets
- complex business logic
you still need some backend logic, but it can be serverless/managed so you don’t manage servers yourself.
If you want, I can recommend the best stack for your app based on:
- iOS/Android/Flutter/React Native
- SQL vs NoSQL
- offline support
- payments
- expected scale