Welcome guest

HTML5 API Documentation

Analytics, Level sharing, Leaderboards and more for HTML5 / JavaScript casual and social games.

Version 1.9

Current as of 11/14/2011. If you see or have any problems let us know!

Setting up the JavaScript/HTML5 API

Add the JavaScript to your page:

<script type="text/javascript" src="http://api.playtomic.com/js/playtomic.v1.9.min.js"></script>

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.