Usage & Examples

Before Getting Started

Before using this plugin, you should first Register an API Client with Patreon.

This plugin supports a few different authentication flows with different trade-offs.

1. Simple & Automatic

This is for you if you just want to check that your users are members of your campaign and find out which tiers/benefits they are entitled to. This allows you to easily do things like unlock specific in-game content for users pledged to specific tiers, display information to the user about their subscription, etc.

Simple Setup

2. Custom

If your needs are more complex, for example maybe you are building an MMO or competitive online shooter and have your own account system you need to link to Patreon, or perhaps you already have your own web service which connects to Patreon and just need to be able to pull specific data out of it from the game client.

Going this route is more complex, but allows you to customize exactly where your tokens are stored, the data fetched from Patreon, how that gets tied into whatever other user data you may have, etc.

Custom Setup


Running the examples

There is a demo map to show basic functionality in: Plugins/NBPatreonAPIClient Content/Examples/Maps/LoginDemo

However, if you run this map you will notice that the login buttons fail with the error:

PatreonAPIClient: Error: Cannot perform authentication: No valid client ID was given!

This is because you have not yet provided your Patreon client ID and secret.

The blueprints for the UI in the demo map are located in:

Plugins/NBPatreonAPIClient Content/Examples/UI/WBP_PatreonLogin_WebBrowser

Plugins/NBPatreonAPIClient Content/Examples/UI/WBP_PatreonLogin_UMGBrowser

Open these and enter the blueprint graph, where you will see the Client ID and Client Secret fields need to be filled in.

Enter the values for the application you created in Patreon, run the LoginDemo map, and it should now allow you to sign in!

It is up to you to decide how to store and handle the Client ID and Client Secret. You could store these as encrypted strings which are only decrypted just before using them, or you might store them outside of your application somewhere and only fetch/download them when needed, etc. If you are developing an open-source project, under no circumstance should you commit these strings to source control.

NOTE: If you sign in with the same Patreon account used to create and manage your campaign, you will not see any entitled tiers. This is normal. To fully test what your users will see, you will need to create a second Patreon account which subscribes to your campaign.

Also note that the user info received from patreon includes a flag which allows you to identify if the user is the creator of the campaign or not. If you are unlocking content for users pledged to specific tiers, you could also use the IsCreator field to unlock everything and enable testing of unlocked content when signed in with your regular creator account.

For an example of accessing and reading information about the Patreon user, see: Plugins/NBPatreonAPIClient Content/Examples/UI/WBP_PatreonUserInfo

Pages






For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com