Skip to content

API Overview

Ttoolab exposes a browser SDK API through its edge worker. This is the primary public HTTP interface for customer integrations.

https://sdk.ttoolab.com

All SDK endpoints are served from this host in production.

SDK endpoints do not require API keys. Authentication is implicit:

  • Bootstrap — validated by projectKey and anonymousId format
  • Events — validated by projectKey in the request body

Do not expose internal service credentials in client-side code.

  • Bootstrap: GET with query parameters
  • Events and surveys: POST with Content-Type: application/json

Successful SDK responses return JSON:

{ "success": true }

Bootstrap returns a JSON blob with assignments, experiments, surveys, and integration settings.

The SDK worker supports cross-origin requests from browsers. Preflight OPTIONS requests are handled automatically.

The SDK JavaScript bundle is versioned internally (1.0.0). HTTP paths are not versioned (/sdk/bootstrap, not /v1/sdk/bootstrap).

GET https://sdk.ttoolab.com/health

Response:

{
"ok": true,
"service": "ttoolab-worker",
"kv": true
}

| Method | Description | | :----- | :---------- | | ttoolab.init(config?) | Initialize with optional projectKey and endpoint | | ttoolab.track(name, payload?) | Send a custom event | | ttoolab.ready(callback) | Callback when bootstrap completes | | ttoolab.getBlob() | Get cached bootstrap data | | ttoolab.getAssignments() | Get current assignments | | ttoolab.getVariant(experimentKey) | Get variant key for an experiment | | ttoolab.clear() | Clear local SDK storage |