Overview
The High IQ API uses a tiered authentication model. Most strain data endpoints are publicly accessible with no authentication required. Protected endpoints use either anX-Admin-Key header (for administrative operations) or Authorization: Bearer tokens (for internal cron jobs and pipeline triggers).
Authentication Tiers
Public Endpoints
The majority of API endpoints are public and require no authentication. These include all strain data retrieval, search, filtering, and catalog operations.User Authentication
User authentication in High IQ is handled through Clerk + Convex, not through the Hono API. The mobile app authenticates users via Clerk SSO (Apple or Google sign-in), and Clerk provides identity tokens that are validated by Convex for real-time user data operations. The Hono API does not validate Clerk JWTs — it serves strain data publicly and protects admin/internal endpoints with API keys.
Admin Authentication
Administrative endpoints are protected by theX-Admin-Key header. This is used for operations like blog image generation, batch processing, and other privileged actions.
Security Features
The admin authentication middleware uses constant-time string comparison to prevent timing attacks. This ensures that an attacker cannot determine partial key matches by measuring response times.Missing or Invalid Key
If theX-Admin-Key header is missing:
Internal Bearer Authentication
Internal endpoints (cron jobs, pipeline triggers) use Bearer token authentication validated against server-side environment variables (API_KEY, CRON_SECRET).
- API Key
- Cron Secret
- Either Key
Security Model
Development Bypass
In development mode or when accessing vialocalhost, authentication is automatically bypassed for both admin and bearer auth middleware. This allows for easier local development and testing without configuring secrets.
NODE_ENV=development- Request host contains
localhost - Request host contains
127.0.0.1
A
DEV_BYPASS_KEY environment variable can also be configured for remote device testing (e.g., testing from a phone on the local network). When set, requests with X-Admin-Key matching this value are allowed through.