What is Purple Token?

First publish in 2014, PT aimed to take a burden off many hobbyist game developers by offering a simple solution to implement high score tracking without the need for them to host their own server. PT is a REST API that will allow your game to submit and retrieve scores with our server. The top 20 scores are stored, dropping the lowest one when a newer higher score is submitted. Each game has the ability to use up to 4 different private keys for access. Some developers like to keep score tables separate on each platform, for instance PC versus mobile. Or maybe they wish to keep Android separate for iOS.


How does it work?

Purple Token (PT) utilizes a REST API because we felt this would be the most widely supported method amongst programming languages. Using GET or POST method over SSL (HTTPS), every transaction will require your game's private key. Keep this key secured, as it's what prevents others from arbitrarily submitting scores from outside your application should they ever get a hold of it. Depending on your language, storing the key as a string constant in your code may not be sufficient as it may be viewable in your executable (opened in notepad or hex editor) even without the use of a decompiler.


The Details

With each game you may register up to 4 unique game keys. This allows you the ability keep scoreboards separate amongst four different platforms. Each key will keep the top 20 scores. If you're only concerned about the top 10 then you can retrieve only the first 10 scores. A timestamp is also record for each score submission, stored in UTC. The ability to retrieve scores with dates configured to your timezone automatically is planned in a future update.


Can I use it with or does it work with ?

While I can't test it with everything in existence it should be fine with anything that can make a url connection. This goes for browser-based games as well and as games embedded on sites such as itch.io have been confirmed to work.