HTML5 / JavaScript API Documentation

Setting up the JavaScript/HTML5 API

Download Browse on Github

Initialize the API by logging the view

A view occurs when someone loads the game in any way. Begin by registering the view early in your game. You must log the view before anything else to initialize the Playtomic API.

Playtomic.Log.View(gameid, "guid", "apikey", document.location);

Check the API page for your game in the dashboard to get your codes. I'm not sure what options exist for protecting your HTML5 game source but you should try and obfuscate your game credentials.

SSL (https)

Premium users can use SSL for all API communication by calling this method before logging a view: