GamebeastDocs
Dashboard
JavaScript SDKAPI Reference

API Overview

All Gamebeast services are properties on the SDK instance: configs, markers, experiments and cohorts.

Every service is a property on the instance you created, in both the browser and on servers:

markers.ts
import { GamebeastClient } from "@gamebeast/sdk/client";

const gamebeast = new GamebeastClient({ apiKey: "abcd-efgh-1234-5678" });

gamebeast.markers.send("example_marker", { value: 42 });
ServiceBrowser (GamebeastClient)Server (GamebeastServer)
ConfigsValues evaluated for the current userBase values, plus evaluate for any user
MarkersAttributed to the current user and sessionAttributed to the user you pass, or to the server
ExperimentsThe current user's assignmentsActive experiments, plus bulk assignment
CohortsIs the current user a member?Membership for any user, or many at once

The two entry points differ where it matters, so each page has a section per entry point, marked like this:

ClientServer

All public types are exported for TypeScript users:

import type { ClientConfigs, ConfigPath, JsonValue } from "@gamebeast/sdk/client";
import type { EvaluatedConfiguration, ServerConfigs } from "@gamebeast/sdk/server";

Unsubscribing

Methods that register a callback (observe, onChanged, onReady, onAssignmentsChanged) return an Unsubscribe function. Call it to stop receiving callbacks, for example when a component unmounts:

useEffect(
  () => gamebeast.configs.observe("game-settings.Banner", (banner) => setBanner(banner)),
  []
);

A callback that throws is logged and never stops other callbacks from running.

On this page