Skip to main content

API keys

Every SmartAI Assessment account has two keys:
Never expose your secret key in browser code or version control. Set both keys as environment variables on your server only.

Live vs test environments

The API key prefix determines which environment you’re in:

HMAC-SHA256 signing

The Backend SDK signs every request automatically. You never need to do this manually. This section is for reference only.

Signature construction

Rules:
  • Body keys sorted alphabetically (nested keys too)
  • Empty body → empty string (not {})
  • Timestamp is Unix milliseconds as a string

Headers sent on every request

Signing reference

Timestamp window

Requests outside the window are rejected with 403 Forbidden.

SDK initialisation

Instantiate once per request (or share a single instance per server process):
The SDK reads both keys and attaches the correct headers and HMAC signature to every outgoing request — you do not pass keys to the frontend or to candidates.