Skip to main content
The API is four endpoints, and calling them directly is fully supported. The SDKs exist for the behaviours in the delivery path that are easy to get wrong: a deadline and a fallback on every decision, idempotent event batching, ordered identity mutations, and never leaking a key or a user field into a log.
Neither package is published to npm yet. Both are built and tested; this documentation describes the surface they ship with. Until they are published, use Raw HTTP, which lists every behaviour the SDKs implement.

The server SDK

@trycurious/node wraps all four endpoints. Its decide() races the request against a deadline and serves your fallback on timeout or any failure; track() queues events with ids that survive retries; identify() and declare() are sent at once and throw typed errors. Pages: Install and configure, Decide, Events and identify, Errors, Examples.

The browser SDK

@trycurious/js is for content rendered in the page. You tag elements with data-curious="element_name"; the SDK decides what each visitor sees as the element approaches the viewport, with the page’s own text as the fallback, under a publishable key. It mints an anonymous id in a first-party cookie, caches decisions for a minute so remounts cost nothing, and queues events that survive a reload. Its elements must be declared beforehand with a secret key, through declare or the server SDK. Full pages arrive with the package’s release.

Raw HTTP

Everything either SDK does is documented so you can do it in any language. See Raw HTTP.