Node.js SDKAPI Reference
API Overview
All Gamebeast services are properties on the GamebeastServer instance: configs, markers, experiments and cohorts.
Every service is a property on the GamebeastServer you created:
import { GamebeastServer } from "@gamebeast/node";
const gamebeast = new GamebeastServer({ apiKey: process.env.GAMEBEAST_SERVER_KEY! });
gamebeast.markers.send("example_marker", { value: 42 }, { distinctId: user.id });| Service | What it does on the server |
|---|---|
| Configs | Base values, plus evaluate for any user |
| Markers | Attributed to the user you pass, or to the server |
| Experiments | Active experiments, plus bulk assignment |
| Cohorts | Membership for any user, or many at once |
All public types are exported for TypeScript users:
import type { EvaluatedConfiguration, ServerConfigs } from "@gamebeast/node";Unsubscribing
Methods that register a callback (observe, onChanged) return an Unsubscribe function. Call it to stop receiving callbacks:
const stop = gamebeast.configs.observe("live-ops.MaintenanceMode", (on) =>
setMaintenance(on === true)
);
// later
stop();A callback that throws is logged and never stops other callbacks from running.