Skip to content

Getting Started

This guide takes you from an empty account to a signed-in player in about ten minutes: create a project in the dashboard, copy the SDK key, install the client SDK, log in with a device ID, and make your first protected call.

EndpointURL
API (game clients and game servers)https://api.rudder.build
Dashboardhttps://app.rudder.build/
  1. Sign up at app.rudder.build with your email and password. New accounts start in a pending state and are unlocked once approved.
  2. Open the Projects page and click Create Project. A name is all you need.

A project is the top-level container for everything: players, counters, installed modules and their data, and keys. Creating a project automatically creates its two environments — staging and prod — each with its own SDK key and its own admin key. A project always has exactly these two. You author content in staging, where you also get a full sandbox with its own players, and promote it to prod, which is what your shipped build reads. See Projects & Environments for the full model.

Open your project and go to Project Settings. The SDK Key field shows the key for the environment currently selected in the dashboard’s environment switcher — switch between staging and prod to see each key.

The SDK key is safe to ship in a game client: it identifies the project and environment, and it is used only at login. If a key leaks, use Generate next to it to rotate it — the old key stops working immediately.

Project Settings also shows an Admin Key, likewise per environment. That one is a secret for server-side admin calls to the /game/v1 HTTP API — the key decides which environment your server acts on, and it must never go into a shipped client.

The package is published to the Rudder registry, not npmjs. Point the @rudder scope at it in your project’s .npmrc:

@rudder:registry=https://hub.rudder.build/api/packages/rudder/npm/

Then install (anonymous read access, no token needed):

Terminal window
npm install @rudder/sdk
import { createClient } from '@rudder/sdk';
const client = createClient({
projectKey: 'your-sdk-key', // the SDK key from Project Settings
});
// Signs the player in with a device ID. The ID is generated on first call
// and persisted in localStorage, so the same browser keeps the same player.
await client.auth.loginWithDevice();
// optionally: loginWithDevice({ region: 'eu', language: 'de', nickname: 'Bob' })

Device login needs no player credentials: the first call with a new device ID creates the player, later calls sign that player back in. Access and refresh tokens are stored by the SDK and refreshed automatically on expiry — you don’t handle tokens yourself. Other login options (a custom webhook against your own backend) are covered in Authentication.

Everything except login requires a signed-in player. Read the player’s profile, wallets and counters:

const profile = await client.player.load();
console.log(profile.player?.id, profile.wallets, profile.counters);
// `client.player` is a state object: subscribe to updates, or read `.value`
// for the cached value after login.
client.player.onChange(({ value }) => console.log(value?.player?.nickname));

If the access token has expired, the SDK refreshes it and retries the call once, transparently.

Module installs and resource rows (items, offers, quests, boards, configs) are live in their environment as soon as you save them; counters take effect after a release. Author and test in staging, then promote to prod, which is what your shipped build reads. For a first end-to-end test: install the remote_config module in staging, create a config, generate a typed client with rudder client generate (see Generated module clients), and call remoteConfig.get using the staging SDK key. The full flow is described in Releases & Publishing and the Releases guide.