Skip to content

Introduction

Before integrating the JOGOS_SDK, please be sure to follow our requirements. It will guide you on the best practices for using the JOGOS_SDK and provide direction on technical, game content, advertising, and account integration requirements. Apart from Unity and Cocos, which can use their dedicated SDKs, your other engines can integrate these features via the HTML5 version, as most game engines supporting WebGL have ways to interact with JavaScript when running in a browser.

The JOGOS_SDK includes the following modules:

ModuleDescriptionSDK SupportIntegration Suggestion
JOGOS_SDK.initInitialize the SDK🟩 Fully Supported☑️ Mandatory, detailed below
JOGOS_SDK.gameGame Behavior🟩 Fully Supported☑️ Mandatory, inform us about your game's load, start, or pause
JOGOS_SDK.userInteract with logged-in users🟩 Fully Supported🔳 Optional, required if using the user system
JOGOS_SDK.bannerIn-game banner ads🟩 Fully Supported🔳 Optional, if your game has Banner ads
JOGOS_SDK.adRewarded video and interstitial ads🟩 Fully Supported🔳 Optional, if your game has video ads
JOGOS_SDK.dataCloud save🟩 Fully Supported🔳 Optional, if you need to use Jogos cloud storage
JOGOS_SDK.friendFriends and groups🟦 Coming Soon🔳 Optional, if your game requires a player interaction system
JOGOS_SDK.paymentIn-app purchases and buy-to-play🟩 Fully Supported🔳 Optional, if your game has in-app purchases or is buy-to-play
JOGOS_SDK.activeAchievements and leaderboards🟩 Fully Supported🔳 Optional, if you need to use Jogos' achievements and leaderboard system
JOGOS_SDK.cdkeyCDKey functionality🟩 Fully Supported🔳 Optional, if you need Jogos to manage CDkeys for you
JOGOS_SDK.gameItemItems & Store🟩 Fully Supported🔳 Not required for single-player games if Jogos manages item lists & paid purchases
JOGOS_SDK.roomBattle Room🟨 Not Supported🔳 Not required if LAN multiplayer is supported and platform provides online rooms

Getting Started

This section explains how to get started and run the JOGOS_SDK within your engine.

Please add the following script inside the body of your game's index.html file to import the JOGOS_SDK:

html
<script src="https://www.jogos.com/sdk/jogos-sdk-v1.js"></script>
Manual Initialization

The JOGOS_SDK requires initialization before use. Initialization is done by calling the JOGOS_SDK.init method:

javascript
let systemInfo = await window.JOGOS_SDK.init();

The JOGOS_SDK.init method is asynchronous, and no other methods are available until JOGOS_SDK.init has been successfully executed. We strongly recommend doing this before your game starts.

If any other method is called before JOGOS_SDK.init is successfully called, an exception will be thrown: "460 Can only be called after the successful call of the JOGOS_SDK.init method"

Promise

The vast majority of methods in JOGOS_SDK are asynchronous and can be called using await:

javascript
try {
const user = await JogosSDK.getUser();
console.log(user);
} catch (err) {
console.log('Get user failed: ', err);
}
//Equivalent Promise calling method:
JogosSDK
.getUser()
.then((user) => console.log(user))
.catch((err) => console.log('Get user failed: ', err));

Download the sample scene for reference: HTML5_Demo.zip

SysInfo Information

After successful initialization callback, you can obtain SysInfo information. Please do not miss this part, as it contains important information about the game engine you are using; you can get the language type used by the platform user; automatically match the localization language when players enter your game. Update the real server time in your game, etc.

javascript
SysInfo{
    "gameId": number; // Game Id
    "hasGameGroup": bool; // Whether group chat is enabled
    "deviceType": "desktop"; // possible values: "desktop", "tablet", "mobile"
    "language": string; // Language type
    "os": "Windows 10"; // OS and version
    "browser": "Chrome 10.0"; // Browser and version
    "serverTime": number; // Current server timestamp
    "bannerIntervalTime": number;//Interval display time for game banner ads
    "MidgameIntervalTime": number;//Interval display time for mid-game interstitial ads
}

Development and Testing

During development, you will execute the JOGOS_SDK in different environments:

  • localhost: When debugging locally, the JOGOS_SDK will attempt to simulate video ads/banners and other behaviors, and will not interact with the service or load real ads.
  • Preview tool: Our QA environment provides real preview and testing functionality. After integrating the JOGOS_SDK into your game, you can preview your game on the Developer Portal once you have created a new game and uploaded the relevant game resource files.