SDK Installation

Here's the instructions about how to install and setup the SDK.

Install Link Game SDK#

Link Game SDK is hosted under https://lg.rgames.jp/libs/link-game-sdk/.

It can be installed by placing a script in your game's index.html. Please make sure it is placed before any game script.

+ <script src="https://lg.rgames.jp/libs/link-game-sdk/1.0/bundle.js"></script>
<script src="{{YOUR_GAME_SCRIPT}}"></script>

SDK versioning strategy#

We release each new SDK version under semantic versioning practice and enable developer to pick a strategy how game can receive SDK updates automatically by utilizing the SDK distribution URL.

There're four available choices:

  • Not to receive any changes: https://lg.rgames.jp/libs/link-game-sdk/1.0.0/bundle.js
  • Good to receive patches (recommended): https://lg.rgames.jp/libs/link-game-sdk/1.0/bundle.js
  • Good to receive patches and also non-breaking changes (excluding experimental features): https://lg.rgames.jp/libs/link-game-sdk/1/bundle.js
  • Want to try out features still under development: https://lg.rgames.jp/libs/link-game-sdk/next/bundle.js

SDK Initialization#

Link Game SDK needs to be initialized for each time a game is started. Game can access all features only after the initialization is completed.

LinkGame.initializeAsync().then(() => {
// Now all features become available
LinkGame.player.getName(); // Getting the player's name
});

Link Game Platform Loading Screen#

The screen will be only closed when meeting these conditions

  1. User has given consent to share information with the game
  2. SDK initialization is completed
  3. Game loading progress is >99%
  4. LinkGame.startGameAsync() is called

Best Practice#

It's considered as best practice to parallelize loading game assets and SDK initialization and only load the necessary assets for the first screen of your game, in order to minimize the initial loading time. Here's an example.

// Load game and initialize SDK in parallel
Promise.all([loadGame(), LinkGame.initializeAsync()])
.then(() => {
// Fill the loading progress bar and start game
LinkGame.setLoadingProgress(100);
LinkGame.startGameAsync();
})
.then(() => {
// Game is started
});