コンテンツへスキップ
ZokoGames

ログイン

このページはまだ翻訳されていないため、英語で表示しています。

Versioning and migration notes

このページの内容

Versioning and migration notes

The script URL is the contract#

https://sdk.zokogames.com/zokogames-sdk-v1.js

The v1 in the file name is the major version. Inside a major version the SDK stays backwards compatible: methods, argument shapes, return values and error codes you already use keep working. The current release is 1.0.0 and the exact number is exported as SDK_VERSION in the bundle (the SDK sends it to the portal during the handshake).

What may change inside v1 without notice:

  • New methods, new optional arguments and new fields on returned objects.
  • New error codes. Always keep a default branch in switch (e.code) that takes the safe path.
  • Calls that are accepted but not yet used by the portal (reportGameCompletedPercentage, setGameContext, trackOrder) start doing something.
  • Bug fixes and stricter validation of arguments that were already documented as invalid.

What requires a new major version (v2) and a long overlap:

  • Removing or renaming a method, argument or documented error code.
  • Changing the meaning of an existing return value.
  • Changing the wire protocol in a way old SDK builds cannot answer.

The portal checks the protocol version during init(). A game built against v1 keeps working while v1 is served.

Do not self-host an old copy#

Load the script from the URL above rather than copying it into your build, so fixes reach your players. If you must bundle a copy (an offline build), keep the ZokoGames global name so the upload validator still recognises the SDK, and update the copy whenever the changelog lists a release.

Migration notes#

1.0.0 (first release)#

There is nothing to migrate from earlier ZokoGames versions. If you come from another portal's SDK, use the migration guide. The points that bite most often:

  • Errors are plain { code, message } objects, not Error instances. Use e.code, not e instanceof Error.
  • init() never rejects. Check SDK.environment instead of catching.
  • SDK.data methods are synchronous and throw, they do not return promises.
  • getUserToken accepts signingKeyType for ported code but signs every token the same way (RS256, one key set).
  • __dangerousUserId is for display only. Identify players on your server through the verified token.
  • There is no client store or purchase API. See in-game purchases.

Engine wrappers#

Wrappers share one browser bridge with the JavaScript SDK. When you update a wrapper, re-export your web build and re-test in the Preview tool. Wrapper-specific changes are listed on each engine page and in the changelog.

How to upgrade safely#

  1. Read the changelog for the release.
  2. Run the game with ?sdk_debug=true and look for new warnings.
  3. Check error handling still takes the safe path for unknown codes.
  4. Test in local mode, then in the Preview tool, then in a build preview from the console.
  5. Ship the update. See updating a live game.

このページに分かりにくい点、誤り、不足はありますか? サポートに連絡する · プレビューツールでゲームをテスト

Cookie設定

ZokoGamesが使用してよいCookieを選んでください。必須Cookieはサイトの動作に必要なため、常にオンです。

  • ログイン、言語、これらの選択内容に使用します。常にオンです。

  • 最近プレイしたゲームなどを、このデバイスに記憶します。

  • ランダムな訪問者IDでプレイ数やページ訪問数を集計し、改善に役立てます。

  • パーソナライズ広告を許可します。広告は無料ゲームの運営を支えています。