Skip to Content
SPAPS is proprietary hosted SaaS. Paid access required; pre-1.0 contracts may change. Terms and access
GuidesAPI Keys And Origins

API Keys And Origins

Application identity is the front door to SPAPS. The middleware dependency layer extracts X-API-Key, validates it against the application table, records the application on request.state, and then applies tighter checks when the key is publishable and browser-facing.

Key Types

TypePrefixIntended callerMain constraint
Publishablespaps_pub_Browser appEndpoint allowlist and Origin validation
Secretspaps_sec_ or spaps_Server processKeep out of browsers and logs
Legacyno required prefixMigration pathDeprecated; production startup checks require disabling legacy auth

Origin Check Flow

Configure Browser Origins

Browser-facing traffic is configured on the application record. Update applications.allowed_origins for the app that owns the publishable key.

UPDATE applications SET allowed_origins = ARRAY['https://buildooor.com', 'http://localhost:3000'] WHERE slug = 'buildooor';

Origin Validation Checklist

CheckCommand or inspectionExpected signalIf it fails
Runtime is reachablecurl -fsS http://localhost:3301/healthHealth response returns successfullyStart with Troubleshooting before editing app records
Local mode is intentionalcurl -fsS http://localhost:3301/health/local-modeLocal-mode state matches the demo or deployment planReconcile DEVELOPMENT_ENVIRONMENT and SPAPS_LOCAL_MODE
Browser origin is allowlistedInspect applications.allowed_origins for the app slugThe exact scheme, host, and port are presentUpdate the app record, not the frontend config only
Webhook and secret traffic use server keysReview caller location and key prefixBrowser uses spaps_pub_; servers keep secret keys off the clientRotate exposed secret keys and move calls server-side

Common Mistakes

Origin-only changes are database changes. They do not require a service restart, but they do require updating the correct application row.

  • Sending Authorization: Bearer <api key> with a JWT-shaped token. API-key extraction intentionally avoids treating JWTs as API keys.
  • Adding an origin to a frontend config file instead of the SPAPS application record.
  • Using a publishable key on an endpoint that requires a secret key.

Next