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:
Module | Description | SDK Support | Integration Suggestion |
---|---|---|---|
JOGOS_SDK.init | Initialize the SDK | 🟩 Fully Supported | ☑️ Mandatory, detailed below |
JOGOS_SDK.game | Game Behavior | 🟩 Fully Supported | ☑️ Mandatory, inform us about your game's load, start, or pause |
JOGOS_SDK.user | Interact with logged-in users | 🟩 Fully Supported | 🔳 Optional, required if using the user system |
JOGOS_SDK.banner | In-game banner ads | 🟩 Fully Supported | 🔳 Optional, if your game has Banner ads |
JOGOS_SDK.ad | Rewarded video and interstitial ads | 🟩 Fully Supported | 🔳 Optional, if your game has video ads |
JOGOS_SDK.data | Cloud save | 🟦 Coming Soon | 🔳 Optional, if you need to use Jogos cloud storage |
JOGOS_SDK.friend | Friends and groups | 🟨 Not Supported | 🔳 Optional, if your game requires a player interaction system |
JOGOS_SDK.payment | In-app purchases and buy-to-play | 🟦 Coming Soon | 🔳 Optional, if your game has in-app purchases or is buy-to-play |
JOGOS_SDK.active | Achievements and leaderboards | 🟩 Fully Supported | 🔳 Optional, if you need to use Jogos' achievements and leaderboard system |
JOGOS_SDK.cdkey | CDKey functionality | 🟦 Coming Soon | 🔳 Optional, if you need Jogos to manage CDkeys for you |
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
:
<script src="https://www.jogos.com/sdk/jogos-sdk-v1.js"></script>
Promise
The vast majority of methods in JOGOS_SDK
are asynchronous and can be called using await
:
try {
const user = await window.JOGOS_SDK.user.getUser();
console.log(user);
} catch (err) {
console.log('Get user error: ', err);
}
They can also be called using Promise
syntax:
window.JOGOS_SDK.user
.getUser()
.then((user) => console.log(user))
.catch((err) => console.log('Get user error: ', 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.
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
}
Development and Testing
During development, you will execute the JOGOS_SDK
in different environments:
localhost
: When debugging locally, theJOGOS_SDK
will attempt to simulatevideo ads/banners
and other behaviors, and will not interact with the service or load real ads.Preview tool
: OurQA
environment provides real preview and testing functionality. After integrating theJOGOS_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.