Install.
Add @splitch/sdk, read the export surface, and get one Flag resolving.
npm install @splitch/sdk@splitch/sdk is ESM only and supports Node 24 or newer, browsers, Cloudflare Workers, and other edge runtimes. Pick the runtime guide for your host: Node.js, Browser client, React bindings, Convex, Cloudflare Workers, or Sentry.
Export surface
| Import | What it is | Extra install |
|---|---|---|
@splitch/sdk | server client: evaluate, peek, verify, evaluateAll, track | none |
@splitch/sdk/browser | static-context browser client with synchronous reads | none |
@splitch/sdk/react | SplitchProvider and the useFlag hooks | react |
@splitch/sdk/sentry | mirror resolutions into Sentry's flag context | @sentry/core |
@splitch/sdk/local-evaluation | the local evaluator the Convex component runs on | zod |
@splitch/sdk/control-plane | typed control-plane client and contract schemas | zod |
The three evaluation entrypoints (., ./browser, ./react) bundle their implementation and pull in no runtime dependency, so adding the SDK to an app adds nothing to its dependency tree beyond React if you use the hooks. ./sentry, ./local-evaluation, and ./control-plane deliberately leave theirs external: a second bundled copy of @sentry/core would not share a client with the host app's, and a second zod would not share schema identity.
Hello world
Paste the keyMaterial field from splitch client-key get (a pk_… value). The response's keyId (ck_…) identifies the key; it is not the credential.
import { createSplitchClient } from "@splitch/sdk";
const splitch = createSplitchClient({ clientKey: "pk_..." });
const variant = await splitch.evaluate("new-checkout", {
targetingKey: user.id,
defaultValue: false,
});That is one HTTP call. There is no local config file to sync and no background poller: the resolution and the Exposure it records happen in the same round-trip.
To create the App, Environment, and Flag this needs, run the platform quickstart first.
splitch