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 */
  },
});
CodeRecoverableDescriptionLikely cause
invalid_gameNogame was missing or didn't match the format.Empty or invalid game.
unknown_gameNoThe provided game ID isn't in the catalog.Typo, or referencing a removed game.
invalid_modeNomode wasn't pinned, daily, or random.Passing an unsupported mode value.
unsupported_modeNoThe game doesn't support that mode (e.g. seeded game with daily).Algorithmic game embedded with daily.
invalid_content_refNoPinned mode without a content value.Forgot to pass the pub_… ID.
publication_fetch_failedYesPublication couldn't be loaded.Bad pub_… ID, or content not yet published.
channel_fetch_failedYesChannel couldn't be loaded for the language.Bad cha_… ID, or no channel for that language.
channel_emptyYesDaily channel has no scheduled puzzle for today.Channel calendar gap. Use a different channel.
game_load_failedYesIframe 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}`);
    }
  },
});