triggair /docs
Quickstart

Wire the backend in one import

Triggair is a game backend for browser games — leaderboards, cloud saves, anonymous player identity, achievements, daily rewards, remote config and deterministic RNG. One import, one publishable key. Errors tell an agent how to fix the call, and a one-command self-test closes the loop.

1 · Install & initialize
npm i @triggair/sdk
import { createClient } from '@triggair/sdk';
const tg = createClient({ key: 'tg_pk_your_key' });
Only the publishable key (tg_pk_) is needed. NEVER put a secret key (tg_sk_) in client code — it belongs on a server.
2 · Identify the player
const { playerId } = await tg.login();
An anonymous player token is minted from a device id on first use and silently refreshed. Player-scoped calls attach it automatically.
3 · Verify the integration
After wiring the SDK, run the MCP tool triggair_verify_integration (or the dashboard's verify runner). It live-probes player + saves + leaderboards and advises on CORS, with pass/fail per service and fix hints — closing the loop.

That's the whole loop. Browse the full recipes for saves, leaderboards, achievements and analytics, and the error reference when something throws. Building with an agent? Point it at llms.txt or paste the Drop-In prompt.