- Docs
- Developer API
- Achievements
Achievements
Achievements with the SDK: setting them up in the dashboard, unlocking them from your game, showing the list, secret and retired achievements, players who are not signed in, and testing.
Achievements are goals your game rewards: "win your first match", "reach level 10", "find the hidden room". You set them up on your game's dashboard; your game unlocks one by its key when the player gets there. The site does the rest:
- The game page shows "Achievement unlocked: …" the moment one is earned, so your game does not need a message of its own (it may still show one).
- The game page's Achievements tool lists every achievement of the game, lights the ones the player has, and counts them ("2/3 earned").
- Earned achievements show on the player's profile, as badges with a card that names the game and the day they were earned. Players can hide any of them from their profile.
Only signed-in players earn achievements. Everything here is optional: a game without achievements works exactly as before.
Set them up in the dashboard
Open your game's dashboard and its Achievements tab. Each achievement has:
| Name | What players see, up to 60 characters: "First win" |
| Key | What your game sends, filled in from the name: 1 to 40 lowercase letters, digits, - and _, starting with a letter or a digit (first-win). A key never changes, because games already send it |
| Description | How to earn it, in a line of up to 200 characters. Optional |
| Icon and colour | One of 60 icons and one of nine colours (gold, orange, red, pink, purple, blue, teal, green, grey) |
| Secret | Until a player earns it, they see "Secret achievement" with no description |
Many achievements, or a list kept in your code? A script can create and change them for you: see achievements from your server.
A game can have up to 100 achievements. Their order on the tab, changed with the arrow keys, is the order players see. The preview beside the form shows the message, the row in the game's Achievements tool and the profile badge as players will see them. Each row has a copy key for the line of code that unlocks it, and shows how many players earned it.
Unlock one from your game
Call unlock() with the key whenever the player reaches the goal:
function onFirstWin() {
ArcadeSDK.unlock('first-win').then(function (achievement) {
if (achievement.new) {
// earned just now; the page has shown "Achievement unlocked"
}
}).catch(function (error) {
// not_signed_in, unknown_achievement, ... (see "Errors" below)
});
}
Unlocking an achievement the player already has changes nothing and answers
new: false, so you can call unlock() every time the condition is met
instead of remembering what you already sent. The answer is the achievement:
{key, name, description, icon, color, new, unlocked_at} (unlocked_at in UTC,
for example "2026-11-27T14:05:00Z").
Show the list in your game
achievements() returns every achievement of the game in your order, with
whether this player has it:
ArcadeSDK.achievements().then(function (list) {
list.forEach(function (a) {
addRow(a.name, a.description, a.unlocked ? 'Earned' : 'Not yet');
});
});
Each item is {key, name, description, icon, color, secret, unlocked, unlocked_at}.
For a guest, every unlocked is false. A secret achievement the player has
not earned comes with the name "Secret achievement", no description and the
colour grey, so the list never gives the secret away. A retired
achievement is listed only to players who earned it.
icon names one of the site's icons and color one of the nine colours: use
them to pick matching art of your own, or ignore them.
Is it on?
supports('achievements') is true, and info.features contains
"achievements", while your game has at least one achievement that can be
earned. With none set up (or all of them retired), the page does not offer
the actions, and unlock() fails with unsupported.
ArcadeSDK.ready().then(function (info) {
if (info.features.indexOf('achievements') !== -1) {
showAchievementsButton();
}
});
When the player is not signed in
info.signed_in is false and unlock() fails with not_signed_in: guests do
not earn achievements. If your game keeps its own record of goals reached (in
localStorage, next to its saves), call unlock() for each of them when the
game starts. A player who played as a guest and signs in later then gets the
achievements they already earned, and calls for ones they have are harmless.
Before your game is published
Players earn achievements once the game is published. Before that, you can
try them on your own game's page: you earn them on your own account, and they
show on your profile like any other. A reviewer playing the game during its
review gets unsupported, so make sure the game carries on when an unlock
fails.
The embed tester answers both actions without any setup: any key you send unlocks once as a made-up achievement named after the key, so you can test your calls before the achievements exist in the dashboard.
Changing and retiring
- The name, description, icon, colour and secrecy can change at any time. Players who earned the achievement see the new words.
- The key cannot change. To replace an achievement, add a new one and retire the old one.
- Retire an achievement to stop it being earned: players who have it keep
it,
unlock()with its key fails withunknown_achievement, and it is no longer listed to anyone else. You can bring it back later. - An achievement nobody has earned can be deleted.
Errors
| Code | Meaning |
|---|---|
not_signed_in |
The player has no confirmed account here, or is signed out |
unknown_achievement |
No achievement of this game has that key, or it was retired |
unsupported |
The page does not offer achievements: the game has none that can be earned, or it is not published yet (and the player is not you) |
invalid_request |
The key is missing or not 1 to 40 letters, digits, - and _ |
rate_limited |
More than 30 unlocks, or 30 lists, in a minute |
server_error |
The site could not complete the request; try again later |
not_embedded, timeout |
As for every action (see getting started) |
Good achievements
- Mark the moments a player is proud of: a first win, a boss, a milestone, a clever trick. Avoid ones that only reward waiting.
- Use secrets for surprises, not for the main goals: a player should know what most achievements ask of them.
- Say how to earn it in the description, in a line.
- Unlock at the moment it happens, not at the end of a session: the message on the page is part of the fun.
An unlock comes from the player's browser, like every score a browser game reports. Achievements show what the game says happened; treat them as fun, not as proof.
Full example
var earned = JSON.parse(localStorage.getItem('my-game-goals') || '[]');
function reach(key) {
if (earned.indexOf(key) === -1) {
earned.push(key);
localStorage.setItem('my-game-goals', JSON.stringify(earned));
}
ArcadeSDK.unlock(key).catch(function () {}); // a guest, or the page is not there: fine
}
ArcadeSDK.ready().then(function (info) {
if (info.signed_in && info.features.indexOf('achievements') !== -1) {
earned.forEach(function (key) { // goals reached while signed out
ArcadeSDK.unlock(key).catch(function () {});
});
}
}).catch(function () {});
// in the game:
// reach('first-win');