Skip to main content
@trycurious/node runs on Node 22+, Deno, Bun, Cloudflare Workers and Supabase Edge Functions. It has no runtime dependencies and uses only web-standard fetch. Secret keys only: a publishable key is refused at construction with invalid_key_type. The browser package is @trycurious/js.
The package is built and tested but not yet published to npm. This page documents the surface it ships with.

What it does for you

  • decide() races the request against a deadline, serves your fallback when it passes or anything fails, never throws by default, and never retries, because a retried decide creates a second decision. Decide.
  • track() mints an idempotency id once per event and keeps it across every retry; flush() hands delivery to your runtime’s lifecycle. Events and identify.
  • identify() and declare() are ordered mutations: sent immediately, retried only on transient failures, and they throw a typed error.
  • Types are generated from the API contract, every response’s X-Request-Id is on the result, and no message ever contains a key, a user field, content or a raw body. Errors.

Install

Construct

Construct one client per process and reuse it: the event queue and the flush timer live on the instance.

Options

Positive numbers are validated at construction; an invalid option throws invalid_configuration before any request is made.