Skip to content

Install it

Your game needs a listing on Alldle first, but it does not have to be live yet. A game’s own SDK page, under its entry in My games, gives you this code already filled in, and shows results as they arrive.

<script src="https://www.alldle.net/sdk.js" data-game="your-game-slug"></script>

The tag creates a ready instance named alldle. You only call it when a round ends:

alldle.completeMode('classic', { won: true, attempts: 3, maxAttempts: 6 });

This address always serves the current version, so you can leave it as it is.

data-game is the end of your Alldle address: alldle.net/game/your-game-slug.

Anywhere on the page where the game runs. In a single-page app with the script tag, add it to your HTML template, and call alldle from the code that ends a round.

In TypeScript with the script tag, declare the global yourself, or use the npm package for types:

declare const alldle: {
completeMode(mode: string, data: { won: boolean; attempts?: number; maxAttempts?: number }): Promise<unknown>;
};

Add data-debug to the script tag, or debug: true with npm. Every call is then logged in the browser console. A wrong slug or domain is always reported there, even without it.

<script src="https://www.alldle.net/sdk.js" data-game="your-game-slug" data-debug></script>

Coming from 0.1? If you load /sdk.js, you are already on 0.2, and AllDle and AllDleSDK.AllDle still work. If you bundled 0.1, upgrade the package: until you do, your own site reports nothing. Your game’s SDK page tells you if the game is still on the old version.

Report rounds, then check that it works.