API for a game?

Hello there !
I want to integrate a button to my game which let’s players link their Patreon account so they can unlock certain content. Problem is, I really don’t know how.

I would really appreciate some help !

Surely you can do that. There are a lot of creators who provide software like that. Be them desktop software, games, remote server software and many others.

Is your game desktop software that is installed in remote computers, or a game that is played on a server that you control?

It is a remotely installed software and also app for android users.

Ok great.

You would need a way to identify remote users first. For example, if the users are saving a license key in these remote installations, that could be a good way to do it. Or, if each installation somehow has a way to identify them differently. Or if your users are logging into your remote software via user/pass that comes from a central app/site of yours. Anything goes.

Then, you can have the users log into your site or remote app (or license server etc), via Patreon to link their remote identity/license/site account to their Patreon. At that point, you would have a link in between their Patreon accounts and their site accounts/licenses, and therefore when the remote game is fired, the remote game can contact your server with the license or the user identity and ask whether the user is a patron from a specific tier. Your site or license server can check the patron record, and reply. At that point the remote game knows whether the user is a patron from the given tier and then enable new features.

You can also use a cron to regularly sync your patrons from Patreon API to your site or license server as well as using a webhook to have Patreon instantly communicate new patrons to your app. Anything that you can make work in your setup.

You could also have users directly log into remote game installations via Patreon, but that’s not a reliable way since any given user’s computer, anti-virus software etc can interfere with the process of contacting the Patreon API regularly, or the user IP can get blacklisted somewhere. Its much better to use your intermediary app to handle the end users.

This is much more sophisticated than I thought since I don’t have a site or a server, the game is hosted by third party websites.

So the first step would be to create a license server unless there is a workaround for my situation.

If the 3rd party sites support integrations, licensing or user identification, you could do it easier.

But propping up a central app is not so difficult. All you need is to have your users log in somewhere. If the 3rd party sites are issuing licenses to those remote game installations, then you don’t even need that.

So the question is whether there is any mechanism in those 3rd party sites for identifying remote game installations.

Can you give me an example for the central app or any recommendation for a server?

Its nothing complicated or big like how it sounds.

You can just slap the PHP lib at some consumer web host and hook it up to a cron. If your campaign is big or you have to process data in detail then you would need a more powerful host though.

There are also examples there to pull your campaign.

For host, whatever you would like works. A simple vm at Linode, Digitalocean, Hetzner etc. You could even go with a shared host if the number of remote installations are not too high.

For database also anything that fits your purpose is ok.

Of course, if you have a considerable number of remote game installations, then you will have to do something more decent.