SDK reference
Error codes
Every error code the SDK can emit through onError. Recoverable errors show a Retry button automatically; the rest indicate misconfiguration.
js
Playgent.init({
/* … */
onError: ({ code, message, recoverable }) => {
/* handle */
},
});
| Code | Recoverable | Description | Likely cause |
|---|---|---|---|
invalid_game | No | game was missing or didn't match the format. | Empty or invalid game. |
unknown_game | No | The provided game ID isn't in the catalog. | Typo, or referencing a removed game. |
invalid_mode | No | mode wasn't pinned, daily, or random. | Passing an unsupported mode value. |
unsupported_mode | No | The game doesn't support that mode (e.g. seeded game with daily). | Algorithmic game embedded with daily. |
invalid_content_ref | No | Pinned mode without a content value. | Forgot to pass the pub_… ID. |
publication_fetch_failed | Yes | Publication couldn't be loaded. | Bad pub_… ID, or content not yet published. |
channel_fetch_failed | Yes | Channel couldn't be loaded for the language. | Bad cha_… ID, or no channel for that language. |
channel_empty | Yes | Daily channel has no scheduled puzzle for today. | Channel calendar gap. Use a different channel. |
game_load_failed | Yes | Iframe failed to load. | Network, CSP, or origin not allowed. |
Recoverable
recoverable: true means the SDK already shows a Retry button to the user. Logging is enough — no need to retry yourself.
Non-recoverable
These are configuration errors that the user can't fix. Catch them in CI:
js
Playgent.init({
/* … */
onError: ({ code, recoverable }) => {
if (!recoverable && process.env.NODE_ENV === "production") {
Sentry.captureMessage(`Playgent fatal: ${code}`);
}
},
});