Skip to main content
The hand-written Client / BrowserClient / Spotzee classes cover the most common browser-side flows: identify, alias, track, register devices, fetch notifications. For server-side integrations, agentic workloads, or anywhere you want full type coverage of the API, the SDK ships a generated typed client at the @spotzee/js-sdk/generated subpath.

When to reach for it

You can mix both surfaces in the same project. They share no state.

Set it up

Set this once at process start. Subsequent calls reuse the configured client. A few notes:
  • baseUrl points at the Main API client surface. Use a publishable key (pk_…) for SDK-style flows or a secret key (sk_…) for full backend access. Read Manage API keys for the distinction.
  • Spotzee-Version pins your call to a known API release date. Read API versioning for the version model.
  • x-spotzee-client-type identifies your traffic. The SDK suggests sdk-js; for an agent or automation, use agent or your own descriptive value. Read Identify your API client type.

Call any operation

Every operation in the OpenAPI spec is exposed as a function on the Spotzee namespace. Each returns { data, error } so you can branch on success without try/catch.
The error shape matches the RFC 7807 envelope on the 2026-04-28 release: code, message, type, request_id. Use code for programmatic branching; message is for humans; request_id goes to support.

Use the exported types

Every component schema in the OpenAPI spec is exposed as a static type under the Spotzee namespace:
Field names on these types match the OpenAPI spec exactly. The typed client does not transform keys, so use the spec’s casing as-shipped.

Pagination

List operations return cursor-paginated results. Walk the cursor explicitly:
Read API pagination for the cursor model and limit ceilings.

Regenerating the client

The generated source is checked in. To regenerate against the live spec at https://apix.spotzee.com/api/openapi.json:
This is rarely needed for app code. Regenerate only when you’re working from a fork of the SDK or want a snapshot of the spec at a specific point in time. The published package ships a build pinned to the Spotzee-Version declared in the SDK’s source.

Mixing surfaces

You can call the typed client from a backend that also uses the ergonomic surface in a frontend bundle. They don’t conflict.

Next steps

Main API reference

Browse the full operation catalogue and request shapes.

Send events from your backend

Recipe for high-volume server-side event ingestion.