Shipeasy
ReferenceTypeScript / JavaScript

Overview

@shipeasy/sdk is the TypeScript / JavaScript SDK for the Shipeasy hosted platform — feature gates, runtime configs, kill switches, A/B experiments, metrics,…

Generated from the SDK's own /docs/ — also served raw at https://shipeasy-ai.github.io/sdk/pages/overview.md.

@shipeasy/sdk is the TypeScript / JavaScript SDK for the Shipeasy hosted platform — feature gates, runtime configs, kill switches, A/B experiments, metrics, and i18n. It ships two entrypoints from one package:

  • @shipeasy/sdk/server — Node, Cloudflare Workers, Deno (authenticates with the server key).
  • @shipeasy/sdk/client — the browser (authenticates with the public client key).

The APIs are framework-agnostic: everything works from vanilla JS. React conveniences live in the separate @shipeasy/sdk-react wrapper.

Mental model: configure() once, then new Client(user)

Configure the SDK once at app startup with your key and an optional attributes transform from your own user object to Shipeasy targeting attributes. Then evaluate per user with new Client(user). The bound Client takes no user argument on its methods — the user is bound at construction.

import { configure, Client } from "@shipeasy/sdk/server"; // or /client

configure({
  apiKey: process.env.SHIPEASY_SERVER_KEY!,
  attributes: (u: MyUser) => ({ user_id: u.id, plan: u.plan }),
});

const flags = new Client(currentUser);
if (flags.getFlag("new_checkout")) {
  /* ship it */
}

What configure() and Client do

  • configure({ apiKey }) is the one-time setup call. It owns the key, the HTTP transport, the blob cache, and the poll lifecycle for the whole process — the first call wins, later calls are no-ops. Test/offline siblings: configureForTesting() and configureForOffline() (see Testing).
  • new Client(user) is a cheap, user-bound handle. It opens no connection and runs no poller — it just binds the resolved attribute bag once at construction. Construct one per user / per request. It exposes getFlag, getFlagDetail, getConfig, getExperiment, getKillswitch, plus track(event, props?) and logExposure(name) — so reading an experiment and recording its conversion/exposure are end-to-end Client-only.

That is the entire surface you wire up: configure once, then new Client(user) everywhere you evaluate.

Where to go next

PageWhat it covers
Installationinstall command, runtime versions, import lines
Configurationconfigure(), attributes, env vars, SSR bootstrap
FlagsgetFlag, getFlagDetail, defaults
ConfigsgetConfig typed values + defaults
Kill switchesgetKillswitch semantics
ExperimentsgetExperiment, ExperimentResult, track
i18nloader, SSR bootstrap, i18n.t()
Error reportingsee() grammar
TestingconfigureForTesting/configureForOffline, override*
OpenFeatureserver + web providers
Advancedmanual exposure, private attrs, bucketBy, sticky
Was this page helpful?
✎ Edit this page

On this page