Version 2 is a smaller, faster SDK with typed flags and rule-based targeting. Most apps migrate in under an hour.
Update the package
The package moved from shoal-js to @shoal/sdk.
Terminal
npm uninstall shoal-js && npm install @shoal/sdkClient creation
TypeScript
import Shoal from "shoal-js";
const client = new Shoal(process.env.SHOAL_KEY, { refresh: 60 });
import { createClient } from "@shoal/sdk";
const client = createClient({ key: process.env.SHOAL_KEY!, pollInterval: 60_000 });Renamed methods
client.enabled(key, user)→client.isOn(key, { user })client.get(key, user, fallback)→client.variation(key, { user }, fallback)client.all(user)→client.bootstrap(keys, { user })refresh(seconds) →pollInterval(milliseconds)
Targeting
v1 targeted users by allow-lists only. In v2, existing lists become individual targets automatically, and you can add rules on top.