Install.
Add @splitch/sdk and get one Flag resolving.
npm install @splitch/sdkThe published @splitch/sdk@0.3.0 package is ESM only and supports Node 20 or newer, browsers, and edge runtimes. It has zero runtime dependencies.
The package exports . as @splitch/sdk, ./browser as @splitch/sdk/browser, and ./react as @splitch/sdk/react. React is an optional peer used only by the React bindings.
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,
idempotencyKey: crypto.randomUUID(),
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.