Working with Supercell API
Dynamic IP and success!
Almost everyone using the official Supercell games API has shown disagreement with the fact that the official API limit key to IP addresses. Lots of the people using the API are using it personally for hobby projects and thus use free services. But that limitation of the Supercell API is causing lots of problem to the free users using the service.
Thus to overcome that issue, I have though of this work around.
Well I am not sure about it to be honest but I am preety sure that things should be fine unless you are doing something really wiered! Although you should be aware of these stuffs:
Important
If you are doing what is mentioned above, you should be safe!
You can customize the service as per your needs. If you need to save the resposes in some database for analytics purposes then you can simply edit the route files i.e. {game}/routes/{file} and customize it as per the need. You can even add custom routes, remove the routes available or modify the available routes as per the requirements.
Yeah I have talked enough as well. The first thing is, the service is built using express and contains a index.js file to be started with. So all you got to do is run the file through command line as node index.js
. But well I don't think you will be running it on your local machine. So I have some steps you can follow to host it over heroku. I do consider you already know about heroku and github.
heroku
branch for it (The heroku branch is setup for hosting at heroku)GLOBAL_MAIL
, GLOBAL_PASS
, CLASH_MAIL
, CLASH_PASS
, ROYALE_MAIL
, ROYALE_PASS
, BRAWL_MAIL
, BRAWL_PASS
GLOBAL_MAIL
and GLOBAL_PASS
if you have the mail and password same over all the developer portalsGLOBAL_MAIL
and GLOBAL_PASS
Will surpass values of other relative variablesDoing all the steps mentioned above, you will have a working version of your service that works to receive data from the official API and works just like it. But currently due to the limitation of heorku, your API will sleep after 30 minutes of inactivity. Well it will not stop working but after that time the initial request will take a longer time. To overcome this limitation you can use service like uptimerobot
// Enabling the games
exports.games = {
clash: false,
royale: false,
brawl: true
};
// Set mail and pass are same across all dev platforms
exports.global = {
mail: 'shared-mail@gmail.com',
password: 'shared-secret-key'
};
// Set mail and pass for single platform
exports.brawl = {
mail: 'your-mail@gmail.com',
password: 'secret-password-here'
};
Technically it is possible by extracting the core of the project i.e. util/tokener.js
in the github repository. This file is the reason behind the success of this concept. So if you want to have completely control over how you do stuffs while having this awesome feature, you can simply get the file from the github repo and use as your requirements.
Well I can understand it's hard to believe something you just read up on internet. But I got a proof of concept to prove my words. CLICK HERE FOR PROOF OF CONCEPT
Thats all from me. But if you got anything you can contact me through my contact mail. But if it is some Bug or feature idea, simply report it over at the original Repository. I will be more than happy to hear feedback from you guys.