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 hosted SPAPS. Send the provisioned key in X-API-Key. Publishable browser keys also require an exact allowed origin; secret keys belong only in server-side secret storage. A secret key does not replace user-session, role, or capability checks on protected routes.

Key Types

TypePrefixIntended callerMain constraint
Publishablespaps_pub_Browser appEndpoint scope and Origin validation
Secretspaps_sec_Server processKeep out of browsers, repositories, and logs

Origin Check Flow

Configure Browser Origins

Add origins through the hosted application settings. Include the exact scheme, host, and port. For example, https://app.example.com and http://localhost:3000 are different origins. The local URL is your frontend; SPAPS remains hosted.

Origin Validation Checklist

CheckCommand or inspectionExpected signalIf it fails
Hosted API is reachablecurl -fsS https://api.sweetpotato.dev/healthHealth response returns successfullyStart with Troubleshooting
Staging credentials are intentionalInspect the provisioned application and key prefixApplication and key type match the staging planReplace copied or production credentials
Browser origin is allowlistedInspect the hosted application settingsThe exact scheme, host, and port are presentUpdate the application setting, not 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

Apply an origin to the correct hosted staging or production application. Treat the environments as separate configuration; never copy production secrets into staging to bypass an origin error.

  • Putting the user JWT in X-API-Key. Send the application key there and the user token in Authorization: Bearer <token>.
  • Adding an origin only to frontend config instead of the hosted application settings.
  • Using a publishable key on an endpoint that requires a secret key.

Next