GamebeastDocs
Dashboard
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:

markers.ts
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 });
ServiceWhat it does on the server
ConfigsBase values, plus evaluate for any user
MarkersAttributed to the user you pass, or to the server
ExperimentsActive experiments, plus bulk assignment
CohortsMembership 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.

On this page