> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trycurious.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK overview

> Which package to use where: the server SDK for Node, Deno, Bun and edge runtimes, the browser SDK, and raw HTTP for everything else.

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.

| Where your code runs | Use | Key |
| - | - | - |
| Node 22+, Deno, Bun, Cloudflare Workers, Supabase Edge Functions | [`@trycurious/node`](https://docs.trycurious.ai/sdks/node) | Secret (`curious_sk_`) |
| A web page | `@trycurious/js` (see below) | Publishable (`curious_pk_`) |
| Any other server language | [Raw HTTP](https://docs.trycurious.ai/sdks/http.md) | Secret |
| A mobile app | Raw HTTP | Publishable |

> [!NOTE]
>
> 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](https://docs.trycurious.ai/sdks/http.md), 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](https://docs.trycurious.ai/sdks/node.md), [Decide](https://docs.trycurious.ai/sdks/node/decide.md), [Events and identify](https://docs.trycurious.ai/sdks/node/events.md), [Errors](https://docs.trycurious.ai/sdks/node/errors.md), [Examples](https://docs.trycurious.ai/sdks/node/examples.md).

## 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`](https://docs.trycurious.ai/guides/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](https://docs.trycurious.ai/sdks/http.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.