Kraty

Quickstart

Sign up, create a game, mint a key, drop in the SDK, and run your first event, all in about ten minutes.

This walkthrough takes you from a blank Kraty account to a live event your players can enter. Plan for ten to fifteen minutes, most of which is filling in event configuration in the portal.

You will end with:

  • A studio + game in the portal.
  • A client_sdk API key in your environment.
  • The Kraty SDK installed and authenticated in your game client.
  • An event your players can start and rank on.

Walk through it

Create a studio

Open the dashboard and sign in with Google or GitHub. A studio is your top-level workspace. It holds members, games, and audit history.

Add a game

Inside your studio, click + New game. A game scopes everything below it: players, events, items, bots, reward tables, and webhooks. One game per shipped title is the usual pattern.

Issue an API key

Under the game's Settings → API keys tab, click + New key and choose client_sdk (for game clients) or server_integration (for your own backend). The full secret is shown once, so copy it into your secret manager immediately.

export KRATY_API_KEY=<your-client-sdk-key>

The key alone identifies your studio + game, so the SDKs do not ask for those separately.

Never embed a server_integration key in a game client; it can mint currency and grant items. Read Authentication before you start integrating.

Wire the SDK

Install the SDK for your stack. Behavior is the same across all three clients.

import { Kraty } from '@kraty/sdk';

const kraty = new Kraty({
  apiKey: process.env.KRATY_API_KEY!,
});

Targets Node 18+ and any modern browser. See the TypeScript SDK guide for install, auth, and runtime configuration.

using Kraty;

var kraty = new Kraty(new KratyClientOptions
{
  ApiKey = Environment.GetEnvironmentVariable("KRATY_API_KEY"),
});

Targets Unity 2022 LTS and newer. See the Unity SDK guide for UPM install and platform setup.

import 'package:kraty/kraty.dart';

final kraty = Kraty(KratyClientOptions(
  apiKey: const String.fromEnvironment('KRATY_API_KEY'),
));

Targets Flutter for iOS, Android, web, and desktop. See the Flutter SDK guide for pubspec.yaml setup.

Create your first event

In the portal, open Events under your game and click + New event. Pick a metric like score, a leaderboard mode, and a schedule. Save the draft, then flip the status from draft to live when you are ready.

The full anatomy of an event (metrics, score formula, modes, reward policy) lives in Events.

Players show up

Your players' attempts flow in through the SDK as they play. A full round is four calls: list, start, report progress, collect rewards:

const kraty = new Kraty({ apiKey: process.env.KRATY_API_KEY! });

// 1) What can this player enter right now? (Auto-registers the
//    active player on this first call.)
const available = await kraty.events.listForPlayer();

// 2) Start an attempt on the event you created.
const start = await kraty.events.start(available[0].eventKey);

// 3) Report progress as they play: `increment` adds, `set` writes.
await kraty.events.progress(available[0].eventKey, start.attempt.id, {
  mode: 'increment',
  metricValue: 1,
});

// 4) Sweep up any rewards the round produced.
await kraty.grants.collectAll();

Bots fill the leaderboard while it is quiet so it never looks empty. Rewards drop when the event ends. Your backend gets a signed webhook the moment each grant lands, and the SDK lets the client claim or open them on the player's next session.

That is it. You are running live ops.