Overview
World Monitor uses a hybrid authentication system that combines origin-based trust with optional API keys. The authentication strategy depends on where requests originate.Authentication Methods
1. Trusted Browser Origins (No Key Required)
Requests from trusted browser origins do not require an API key: Production Origins:https://worldmonitor.apphttps://*.worldmonitor.app(subdomains)https://worldmonitor-*-elie-*.vercel.app(Vercel previews)
http://localhost:*http://127.0.0.1:*
https://tauri.localhost:*https://*.tauri.localhost:*tauri://localhostasset://localhost
2. Desktop Applications (API Key Required)
Desktop applications always require a valid API key, even fromtauri://localhost origins.
Your World Monitor API key. Required for desktop apps and third-party integrations.
3. Third-Party Applications (API Key Required)
Requests from unknown origins or without anOrigin header must provide a valid API key.
How to Authenticate
Browser Requests (Trusted Origins)
No authentication needed for same-origin requests:Desktop App Requests
Include theX-WorldMonitor-Key header:
Third-Party Integration
Include the API key header:CORS Configuration
The API implements Cross-Origin Resource Sharing (CORS) with strict origin validation.Allowed Origins
CORS headers are set based on the request origin:- Trusted origins:
Access-Control-Allow-Originreflects the request origin - Untrusted origins: Request is rejected with
403 Forbidden - Missing origin: Falls back to
https://worldmonitor.app
CORS Headers
All responses include:Preflight Requests
The API handlesOPTIONS preflight requests:
Authentication Flow
The API processes requests in this order:-
Origin Check: Validate request origin against allowed patterns
- If origin is disallowed →
403 Forbidden - If origin is missing → Continue to key validation
- If origin is disallowed →
-
API Key Validation:
- Desktop origin: API key required
- Trusted browser origin: API key optional (if provided, must be valid)
- Unknown origin: API key required
- No origin + no key:
401 Unauthorized
- Rate Limiting: Check IP-based rate limits (see Rate Limits)
- Request Processing: Route to appropriate handler
Error Responses
Invalid API Key
401 Unauthorized
Missing API Key (Required)
401 Unauthorized
Desktop Access Without Key
401 Unauthorized
Origin Not Allowed
403 Forbidden
Security Best Practices
Key Management
- Environment Variables: Store keys in
.envfiles (never commit to git) - Rotation: Rotate keys periodically
- Scoping: Use different keys for different environments (dev, staging, prod)
Origin Validation
The API uses strict origin validation:Originheader from TCP connection (x-real-ipfrom Vercel/Cloudflare)Refererheader as fallback for same-origin requests- Client-settable headers like
x-forwarded-forare ignored
Obtaining an API Key
API keys are currently issued manually. To request an API key:- Contact the World Monitor team
- Provide your use case and expected request volume
- Receive your API key via secure channel
WORLDMONITOR_VALID_KEYS environment variable (comma-separated list).
Next Steps
Rate Limits
Understand rate limiting and quotas
API Reference
Explore available endpoints