Security and keys
Perkamo separates trusted backend operations from browser or mobile integration work. Server API keys can write events, read profiles, redeem rewards and upload config depending on scopes. Browser clients must never receive server API keys.
Server API keys
Store server keys only in backend environment variables or a secrets manager.
Create, rotate and revoke keys in Secret keys.
env
PERKAMO_SPACE=commerce-live
PERKAMO_SECRET_KEY=sk_live_...Create one key per integration when possible. Rotation and revocation are safer when checkout, CRM sync and reporting do not share a single key.
Scopes
Server keys can be scoped to:
| Scope | Allows |
|---|---|
events:write | POST /v1/identify, POST /v1/events, POST /v1/events:batch |
profile:read | GET /v1/profile/{user_id}, GET /v1/program, GET /v1/usage |
rewards:redeem | POST /v1/rewards/redeem |
admin:config | POST /v1/admin/config/{module} |
Browser-token boundary
Do not bundle server API keys in browser, mobile or widget code. The current stable public v1 API is backend-first. Browser-token key metadata and allowed request origins can be configured in the console, but client-safe /v1/client/* routes and profile stream token verification are preview work, not stable v1 API surface.
Until that flow is enabled for a customer integration, keep browser apps behind your own backend. Your backend verifies the user's session, calls Perkamo with a server key and returns only the state your UI needs.
Browser request origins are configured in Perkamo as exact origins:
https://app.example.comhttps://shop.example.comhttp://localhost:3000for local development
Manage allowed origins in Browser SDK.
Do not enter CSP directives, paths or wildcard domains into allowed request origins. CSP remains a header on your own website:
http
Content-Security-Policy: connect-src 'self' https://api.perkamo.com;Data minimization
Send only facts Perkamo needs for rules, audit and support. Avoid card data, passwords, authentication tokens and unnecessary personal data.
Retry safety
- Retry network failures, timeouts and
5xxwith the same transaction id. - Do not retry
400,401or403automatically. - Use exponential backoff for
429. - Treat
duplicate: trueas a successful replay.