Usage & Examples

Before Getting Started

Before using this plugin, you should first Register an API Integration with SubscribeStar.

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 tier they are subscribed to. This allows you to easily do things like unlock specific in-game content for users subscribed to specific tiers, display information to the user about their subscription, etc.

This can be done with just a couple of BP nodes or a handful of lines of C++.

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 are linking to SubscribeStar, or perhaps you already have your own web service which connects to SubscribeStar for other reasons 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 SubscribeStar, 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:

Engine/Plugins/NBSubscribeStarAPIClient Content/Examples/Maps/LoginDemo

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

Error: Ensure condition failed: !ClientID.IsEmpty()  [...\NBPerformSSAuthenticationAction.cpp] [Line: 123]
Error: Cannot perform SubscribeStar authentication: No valid client ID was given!

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

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

/Examples/UI/WBP_SubscribeStarLogin_WebBrowser

/Examples/UI/WBP_SubscribeStarLogin_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 integration you created in your SubscribeStar profile, 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.

Pages






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