JavaScript SDK

Introduction

Welcome to the Ocugine Platform. With JavaScript SDK you can develop your games faster, using dozens of ready-to-use modules for your projects. You can use our SDK for WebGL games or HTML5 applications.

Note: You need to create an Ocugine Account and your first project to work with this SDK. Learn more about first steps.

Browser Compatibility

  • Chrome >= v.58 (Apr 2017)
  • Firefox >= v.54 (Jun 2017)
  • Edge >= v.14 (Aug 2016)
  • Safari >= v.10 (Sep 2016)
  • Opera >= v.55 (Aug 2017)

Installation

Connect our SDK library for your project:

<script type="text/javascript" src="https://cp.ocugine.net/cdn/js-sdk-041/ocugine.js" crossorigin="anonymous"></script>

Or use minified version:

<script type="text/javascript" src="https://cp.ocugine.net/cdn/js-sdk-041/ocugine.min.js" crossorigin="anonymous"></script>

If you want to use our UI Module from JS SDK you need to connect CSS:

<link rel="stylesheet" href="https://cp.ocugine.net/cdn/js-sdk-041/ocugine.css" crossorigin="anonymous">

Setup SDK

So, you can initialize Ocugine JS SDK by few lines of code:

// Initialize SDK
let OSDK = new OcugineSDK({ // App Settings
    app_id: APP_ID, // Your Project ID
    app_key: APP_KEY // Your Client Key
}, SDK_SETTINGS, DEBUG_MODE);

Where:
| Param | Type | Description |
| APP_ID (required) | double | Project ID for your application. |
| APP_KEY (required) | string | Project Client Key for your application. |
| SDK_SETTINGS | object | SDK Settings Object. |
| DEBUG_MODE | bool | Enabled / Disabled debug mode |

SDK Settings Module:
| Param | Type | Description |
| show_ui | bool | Show built-in UI for methods. Required jQuery. |
| language | string | API Language |
| auto_analytics | bool | Auto Analytics for your project |
| plaform | string | Game Platform |
| auto_reports | bool | Auto Reporting (Errors) - Error's Logging |

Available Objects

The list of available object:

  • OcugineSDK - General SDK Class;
  • Ocugine_Auth - OAuth Authentication Class;
  • Ocugine_Analytics - Analytics Class (for example: events and conversions);
  • Ocugine_Gaming - Game Services Class (for example: achievements);
    • leaderboards - Leaderboards Object;
    • achievements - Achievements Object;
    • missions - Missions Object;
  • Ocugine_Monetization - Monetization Class;
  • Ocugine_Notifications - In-Game Notifications class;
  • Ocugine_Marketing - Marketing Class;
  • Ocugine_Ads - Advertising Class;
  • Ocugine_Backend - Cloud Management Class;
    • storage - Storage Object;
    • saves - Cloud Saves Object;
    • database - Database Object;
    • multiplayer - Multiplayer Object;
    • liveconfs - Live Configs Object;
    • backend - Backend Builder Object;
  • Ocugine_Reports - Errors and Performance Reporting Class;
    • errors - Errors Reporting Object;
    • performance - Performance Reporting Object;
  • Ocugine_Localization - Localization Class;
  • Ocugine_Users - Ocugine Users Class;
    • policy - Policy Management Object;
    • users - Users Management Object;
    • support - Support System Object;
    • chats - Chats Object;
    • dialogs - Personal Messages Object;
    • reviews - Reviews Object;
  • Ocugine_UI - Ocugine UI Modules Class (Requires jQuery);
  • Ocugine_Utils - Ocugine Utils Class

What's Next?

Learn more about Ocugine SDK and Platform here or go to the Dashboard.