DocsGame integration

Game SDK

Connect your game to player identity, saves, rooms, scores and purchases.

Load the SDK

The SDK connects a browser game to Looping without exposing a wallet, session or private key. Pin a full version so the game and its replay verifier load the same code.

JavaScript
import { looping } from "/_looping/engines/sdk@0.3.4/src/index.js";

The path above works on a Looping game host and follows its environment. Test the integration in your private preview so it uses the same SDK and player services as the published build.

Bundled builds should load the SDK at runtime. Keep the calls on sdk.looping so the build checker can recognize them after minification.

JavaScript
const SDK_URL = "/_looping/engines/sdk@0.3.4/src/index.js";
const sdk = await import(/* @vite-ignore */ /* webpackIgnore: true */ SDK_URL);

// Once your playable screen has rendered:
sdk.looping.ready();

Report the first frame

Call looping.ready() once the playable screen is up. The platform records this boot signal and includes it in the build report. Importing the SDK alone does not mark a game ready.

APIUse it for
player()The player’s display name and sign-in status
savesProgress, settings, format migrations and save history
roomsRooms, matchmaking, private invitations and teams
storeCatalog, checkout and verified ownership
startRound() / finishRound()Platform-minted rounds and score submissions
onCheck()A check hook for multiplayer and store testing

SDK example

This example comes from the SDK's tested example file. The store item and room policy must exist on your project before you use those calls.

JavaScript
import { looping } from "/_looping/engines/sdk@0.3.4/src/index.js";

looping.ready();                                          // the playable screen is up
const me = await looping.player();                        // { signedIn, name }: a short name, never an email, a wallet or keys
const { items, mode } = await looping.store.items();      // the catalog, prices set on the platform
const owned = await looping.store.owned();                // [{ sku, count, test }], verified on the platform: restore on load
const bought = await looping.store.buy("golden-lantern"); // the platform draws its own checkout → { sku, txHash, test, count }

const { data: progress } = await looping.saves.load();    // this player's save for this game: null the first time
await looping.saves.save({ ...progress, visits: (progress?.visits ?? 0) + 1 }); // any JSON value, up to 32 KiB

const { round, seed, minted } = await looping.startRound(); // the platform mints the round; seed your game with it
await looping.finishRound(1234);                          // the score, attributed to the player by their room token

const room = await looping.rooms.join("harbor-1", { max: 4, public: true });
room.on("join", (p) => console.log(`${p.name} joined`));
room.on("away", (id) => console.log(`${room.player(id).name} dropped; their seat is held for 15 s`));
room.on("message", ({ from, d }) => console.log(from, d));
room.send({ x: 3, y: 4 });                                // relay: to everyone else in the room
room.set("phase", "playing");                             // shared state, last writer wins

For the complete contract, call engine_docs with engine: "sdk" and doc: "SDK.md". Add a section such as “Saves” or “Private rooms and invite codes” to read one part.

Unity Web builds

Publish a Unity 6 Web build made in your own Unity Editor. Looping never compiles it. The com.looping.sdk package adds the WebGL template and a C# API.

The package is verified on Unity 6000.6.3f1 and installs from the Looping repository by path; it is not in a registry yet. Ask your agent to read looping-unity with skill_read and UNITY.md with engine_docs.

The SDK and Unity package use the Looping Platform License for games on Looping, and only there.