splitchAlpha

DocsSDKinstall.md

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

ImportWhat it isExtra install
@splitch/sdkserver client: evaluate, peek, verify, evaluateAll, tracknone
@splitch/sdk/browserstatic-context browser client with synchronous readsnone
@splitch/sdk/reactSplitchProvider and the useFlag hooksreact
@splitch/sdk/sentrymirror resolutions into Sentry's flag context@sentry/core
@splitch/sdk/local-evaluationthe local evaluator the Convex component runs onzod
@splitch/sdk/control-planetyped control-plane client and contract schemaszod

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.