Install
Pick a class
Initialise
The SDK needs a publishable API key. Read Manage API keys for how to create one. Usepk_… keys for client builds (browsers, mobile, anywhere the key is visible to end users). Server-side jobs that already have a backend can use either a publishable key for SDK flows or a secret key (sk_…) for the typed client.
track / identify from your own storage.
What every request carries
Every call the SDK makes adds these headers automatically. You don’t need to set them yourself.
The SDK also converts JavaScript camelCase property names to snake_case before sending, so calling
identify({ externalId: 'u_42', timezone: 'Australia/Sydney' }) puts external_id and timezone on the wire.
Errors
Failed requests throw anError whose message includes the HTTP status, the API error code (when present), the human-readable message, and the request_id for support. The SDK parses the RFC 7807 envelope on 2026-04-28 and falls back to the legacy { error: string } shape across the cutover.
request_id when contacting support so the team can find the request in the platform logs.
Debugging
The SDK doesn’t ship a debug toggle. Use your runtime’s standard tools.- Node. Set
NODE_DEBUG=http,httpsto see outbound requests, or wrap the SDK call in a logging block. The SDK’s thrown error already contains everything support needs. - Browser. Use the network panel of your browser’s developer tools to inspect the request and response payloads. Filter by
apix.spotzee.comto isolate Spotzee traffic.
Next steps
Identify users
Link anonymous activity to a known user, set traits, and alias on sign-up.
Track events
Send custom events with properties to trigger journeys and segment users.
Devices and notifications
Register browser or web push tokens, fetch in-app notifications.
Typed API client
The full OpenAPI surface for server-side and agentic use.