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.
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.
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 and where 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
- Registering an API Client
- Client Secrets
- Simple Setup & Usage
- Custom Setup
- Utilities
- Using Pledge History
- Troubleshooting
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Registering an API Client
Before you can use the Patreon API, you need to create an application client and API keys for your campaign.
-
Navigate to: https://www.patreon.com/portal/registration/register-clients
-
Click the
Create Clientbutton -
You must set the
Client API Versionto2, and fill in theApp Name,Description, andRedirect URIsfields.The value used in the
Redirect URIsfield depends on how you plan to configure and use the plugin (below). You can edit this value at any time later if necessary.If you plan to handle everything within the game client, then the game client will expect the redirect at
http://localhost:8080/loginby default. This can be customized, though.If you plan to use your own web service to proxy the authentication, then the
Redirect URIshould point to your web server.
Once you have created a Client, you will need the Client ID and Client Secret.
Do not use the Creator's Access Token!!

For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Client Secrets
When you register an API client you will get a Client ID and Client Secret. These values are used to identify your application and tell Patreon that the app making the calls to authenticate a user are coming from code you trust.
The Client ID is included in the URL used by your users to sign into Patreon, as such it will always be known to anyone who uses your app and can essentially be considered as public information. It is impossible to hide your Client ID.
The Client Secret, on the other hand, is not required to be exposed to all your users. It is also used during the authentication process, but it is optional, and if it is used there are steps you can take to hide it from your users. In general, Client Secrets are meant to be secret, but as long as you can access the same information using only the Client ID it's a bit of a moot point.
Do I need to use a Client Secret?
The short answer is No. You can leave the Client Secret parameter on PerformAuthentication empty and everything should work fine, only the Client ID is required.
The long answer is: Patreon's API Documentation always describes the Client Secret as being required for authentication. While it works fine right now to omit the Client Secret, it might not be something they want to support in the future and this may change. Personally, I'm not worried about this happening any time soon: Patreon's API is, frankly, poorly supported and seldom updated, so I doubt this will change any time soon (if ever).
If you are building an application which will see ongoing support (like most Patreon-funded games) then the risk of not using the Client Secret is pretty small. In the worst-case scenario, authentication in older builds breaks and you will have to push an updated build which uses the Client Secret. If you are building an application you no longer intend to support and update, however, a change to Patreon's authentication could leave your last-published build broken and your users without any way to fix it.
If I want to use a Client Secret, how do I protect it?
The only way to absolutely guarantee no user is able to access your Client Secret is to never allow it to touch their computer in the first place. A typical way to do this would be to create a separate web service which runs on a server that you control, then when the user signs in to Patreon they are first redirected to that web service (which holds your Client Secret). That service then uses the client secret to complete the user's authentication and cache the user's tokens, and finally your game client requests the tokens (or information obtained from the Patreon API using those tokens). There are notes on how to work this way using this plugin on the Custom Setup page.
If you don't want to set up an external service, then you will need your game client to have access to the Client Secret. You can take some steps to make it more difficult for a user to extract, but you cannot make it impossible.
- Encrypt the
Client Secretstring, then only decrypt it when you use it and immediately free that string from memory afterwards. - Store the
Client Secret(encrypted) on some external server somewhere where your game client can fetch it, then it will only exist in RAM when your game is running not on disk.
Steps like these can make it more difficult for a user to extract the secret from your game, in the end the secret needs to be sent over the network to Patreon as part of the authentication process. Regardless of how much encryption you apply when the secret is not being used, a user who has the tools to monitor their own network traffic will be able to sniff it out eventually.
The primary risk of having your Client Secret leaked is that someone else could build an application which uses your Client ID and Client Secret to pretend to be your game. Users could then be tricked into signing in to Patreon through this fake app which would now have access to the same information as your game: their names, pledge information, possibly more personal information like their e-mail address, etc. As long as the Client ID is sufficient to get this information without a Client Secret, though, the Client ID itself can carry this risk.
If you suspect another person has copied your Client ID and/or Client Secret and are trying to trick your users into signing in through some fake game/application, you should immediately delete your API client and create a new one, then publish an updated build of your application using the new Client ID. This will immediately stop any bogus app using the old ID from working and will invalidate any access tokens it was able to obtain.
What about access tokens?
When you call PerformAuthentication, a struct containing the user's Access Token is returned. This Access Token is used to request information on behalf of the user, and as long as the access token is valid (usually for 30 days) using it does not require the user to sign-in again.
The nice thing about this is if you save the token info you can avoid needing to ask the user to sign-in too often. The risk of doing this, however, is that if a user's access token falls into the hands of a hacker, that hacker can also use it to request the same information from Patreon about the user. Because of this, it is recommended to consider whether or not you really need to store the access token, and if so to be careful how you do so.
If you do save the user's access token, it is strongly recommended NOT to save it in plain text. If you encrypt it before writing it to their save file, it will be that much more difficult for an attacker to recognize what it is and figure out how to read it. Rather than just writing a virus which scans everyone's PC for files that look like access tokens, they will have to construct an attack specifically for your game which should greatly reduce the odds that they even bother.
If the in-game rewards you want to unlock for a user are permanently given once unlocked (i.e. you don't want to revoke them if the user unsubscribes from your Patreon campaign), then rather than storing the access token you can just use it once to unlock the content and then only save some information about what content was unlocked. In this case, the access tokens are temporary and don't need to persist on the user's machine.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Simple Setup & Usage
This is the simplest approach, and for most projects which just need to gate some content behind subscription to a specific tier you probably won't need to get more complicated than this.
You will need your Client ID. The Client Secret can also be used, but it is optional.
Your Redirect URI in your registered client should start with http://localhost
The process will work like this:
- You open the Patreon login and consent page for your user (either using their default web browser or the UMG Web Browser widget).
- While they are signing in and granting your application access to their data, we start up an HTTP server
a. By default the server will listen for a request at
http://localhost:8080/login, but you can customize this as you see fit b. Whatever you configure the server to use, you need to ensure that your application's configuration on the Patreon side has a matchingRedirect URI, e.g. if you setCallback Routeto/patreonandCallback Portto9999, you must update the settings in Patreon to include aRedirect URIofhttp://localhost:9999/patreon.The
Callback RouteMUST start with"/"and be longer than just"/"but can otherwise be anything you want.The
Callback PortMUST be a positive integer, and unless you plan to use port80should be larger than1024 - After consenting to sharing their data with your application, Patreon will make a request to the built-in HTTP server with a one-time use code we use to obtain an
Access Tokenon behalf of the user. - Once we have an access token, we use this to request the user's account information, including any tiers and benefits they are entitled to.
- You can then use this information as you want, e.g. checking if they are pledged to a specific tier and unlocking some content for them.
That sounds like a lot, but steps 1-3 are encapsulated inside of a single function which can be chained to a second function to handle step 4 for you, leaving only the actual logic for your application in step 5 up to you to implement.
Blueprint

C++
#include "Actions/PerformAuthenticationAsyncAction.h"
#include "Actions/GetPatreonUserInfoAsyncAction.h"
#include "APITokenInfo.h"
#define CLIENT_ID TEXT("<Your Client ID>")
#define CLIENT_SECRET TEXT("<Your Client Secret>") // optional
void MyClass::DoPatreonLogin() {
// create an authentication action expecting a callback at http://localhost:8080/login
UPerformAuthenticationAsyncAction* authAction = UPerformAuthenticationAsyncAction::PerformAuthenticationAsyncAction(
this, // world context
CLIENT_ID,
CLIENT_SECRET // can be set to an empty string
// callback route defaults to "/login"
// callback port defaults to 8080
);
// register callbacks for results
authAction->OnComplete.AddDynamic(this, &MyClass::OnAuthenticationComplete);
authAction->OnFail.AddDynamic(this, &MyClass::OnAuthenticationFailed);
// kick off action
authAction->Activate();
}
void MyClass::OnAuthenticationComplete(FAPITokenInfo TokenInfo) {
// now that we have a token, we can use it to fetch information about the user who just logged in
UGetPatreonUserInfoAsyncAction* getInfoAction = UGetPatreonUserInfoAsyncAction::GetPatreonUserInfoAsyncAction(
this, // world context
TokenInfo
);
getInfoAction->OnComplete.AddDynamic(this, &MyClass::OnGetUserInfoComplete);
getInfoAction->OnFail.AddDynamic(this, &MyClass::OnGetUserInfoFail);
getInfoAction->Activate();
}
void MyClass::OnAuthenticationFailed() {
UE_LOG(LogTemp, Error,
TEXT("Patreon authentication failed: The user may have denied the request for their data")
);
}
void MyClass::OnGetUserInfoComplete(FPatreonUserInfo UserInfo) {
// now that we have the user's information,
// we can check if they have pledged to a tier with unlockable content
if (UserInfo.HasTier("Special Tier")) {
UnlockSecretConent();
} else {
// suggest the user should pledge to the Special Tier ;)
}
}
void MyClass::OnGetUserInfoFail() {
UE_LOG(LogTemp, Error,
TEXT("Fetching user info from Patreon API failed: Was the access token invalid?")
);
}
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Custom Setup & Usage
If you plan to run your own web server to handle part or all of the authentication and communication with Patreon's API, then this section is for you.
Why do it this way?
If you have your own account system (e.g. maybe you are developing a MMO) then it may make the most sense to associate your users' accounts with their Patreon accounts and store their access tokens alongside the other account data you have for them. In this way, you would just need to ask them to connect their Patreon account to your servers once, then when they login to your game client you can send their Patreon info alongside whatever other account details your game receives.
Alternatively, if you are concerned about the security of your Patreon Client Secret, the only completely reliable way to prevent your users from
ever being able to extract it is to prevent the application from ever seeing it in the first place. Even without your own account system, you could
still run a web service which just handles the code exchange to get an access token after a user logs in to Patreon, then either ask the user to
copy-and-paste this into the game or cache the access tokens on your server and provide an API to fetch them.
(side note: use of the client secret is optional)
If you find that the information we retrieve from the Patreon API in Get User Info is insufficient for your use case, then you may also want to go the custom route to make the specific API requets you need (if you find yourself going down this road, though, please drop me a note so I can consider supporting your use case better by default in the future).
Several BP nodes for making HTTP requests are provided for those who prefer to work entirely in blueprints, and helpers are provided for C++ developers to simplify things from that side as well. If you feel there is anything missing to enable the workflow you want to implement, or anything could be added to help make your life easier when implementing a custom solution, please feel free to let me know!
Example
As an example, let's say you just want to protect your Client Secret, so you have a web server somewhere which can receive the authentication callback
from Patreon after a user signs in and accepts to sharing data with your applicatoin.
First, the authentication & consent page the user gets sent to must be parameterized with a Redirect URI pointing at your server. There are several nodes to make this easier from blueprint:

Because the user will be redirected to your web server, the game client will not be able to know when the authentication has completed and a new access token is available.
Some people will simply display the access token on the redirect page and ask the user to copy-and-paste it into a text field in the game. If you want to avoid this
and make the experience a little more automatic and seamless, though, you can create and send a unique ID with your request (the Patreon Auth Id in the image above).
This value will also be sent to the redirect URL as a state query param, so both the game client and your server have the same Id which can be used to tie the
two requests together. See Patreon's documentation for more information.
In the example above we are creating a new Id string for every request, but if you have another way of identifying your users (e.g. if you have your own account service this could be their user ID or some other identifying string you create for them). Once the user returns to the game client, you can then send another request to your server asking for their access token, passing the same Id so the server can look it up among all the patreon users it has processed:
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Extra Utilities
Campaign Information
Sometimes it's useful (or necessary) to know your Campaign ID or the IDs of the tiers associated with your campaign. Patreon doesn't expose this information in an easy location, so an editor utility is provided to make it more accessible.
You can launch the utility from Tools > Get Campaign Info
Paste your Client ID into the field at the top of the form, set the CallbackRoute and CallbackPort to match the values you use for authentication, and then click the Fetch Campaign Info button. You will be asked to sign into Patreon, and you must use the account which owns the campaign (if you use another account you will see an error in the console log).
This willd download some information about your campaign and display it with buttons to easily copy the IDs to your clipboard:

What can I use this for?
The most common use is to be able to pass your Campaign ID to Get User Info or Get Pledge History. If you ever perform a request against the API which returns information about multiple campaigns, providing your own Campaign ID to these functions will ensure that you only get data related to your campaign in their outputs, which greatly simplifies the number of details you need to handle.
Additionally, it is possible to query for Tiers both by name and by ID. Querying by ID has the advantage that if you ever change the name of a tier you do not need to update your application--the ID will remain the same.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Using Pledge Histories
In some cases, you might need to know not just whether a user is pledged to a particular tier right now but whether they have ever pledged to a tier, or if they were pledged during a specific time period in which you ran an event, etc. For example, you may decide to give a permanent reward to everyone who pledges during January, then even if someone unsubscribes and launches the game in April you want to be able to ensure they are still able to receive that reward.
These scenarios can be supported by fetching the user's pledge history (the history of changes to their pledge status) and searching through it to discover when they were pledged to a given tier.
Scope Notes
In order to request a user's pledge history, it is necessary to to request the identity.memberships scope. By default, when performing authentication only the identity scope is requested, so you must provide the complete list of scopes you need in the Scope Overrides parameter. This is most likely: identity identity.memberships
An important side-effect of enabling the identity.memberships scope is that many API queries will begin returning data not only about your campaign but about all campaigns the user is pledged to! To deal with this, you should pass your Campaign ID to any node which accepts it (e.g. Get Usre Info). This will allow the plugin to filter the data received from Patreon for you and extract only the data relevant to your campaign. An editor utility is provided to make getting your Campaign ID easier.
For more information on the scopes supported by the API, see here: https://docs.patreon.com/#scopes
It is important to note that once a user has authorized the use of a scope, Patreon's API will always process API requests for this user as having this scope (even if in the future you reduce the scopes you request). This means that if you enable the identity.memberships scope then later decide that you don't need it, Patreon will still process requests as if you have requested it. The only way to reduce the scopes the API uses is to create a new API client and migrate your application to the new Client ID.
Best Practices
It is important to be aware that not all actions a subscriber takes which may affect their eligibility for a particular tier or reward are captured in their pledge history. For example, a gifted subscription does not show up in the user's pledge history. This means that if your goal is to answer the question, "Was this user entitled to Tier A during the month of January?", the information in the pledge history cannot give you a definitive answer in all cases. If the user paid for a subscription during January you will be able to see that in their history, but if they were on a gifted subscription, a free member, etc., their pledge history may be empty.
For this reason, to ensure the widest range of cases are covered, it is recommended to always first check the user's current entitlements and only fall back on checking their pledge history if they aren't currently pledged to the tier you're looking for.

For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Troubleshooting
Logs
All logs produced by this plugin are created under the PatreonAPIClient log category

C++ Headers
If you are working in C++ and keep getting "File not found" errors when attempting to include headers from this plugin, make sure you have added the plugin as a dependency for your project in your Build.cs file:
public class MyModule : ModuleRules
{
public MyModule(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
// \/ Add NBPatreonAPIClient as a dependency to allow access to plugin header files, etc.
PrivateDependencyModuleNames.AddRange(new string[] { "NBPatreonAPIClient" });
}
}
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Blueprint API Documentation
An overview and explanation of all included Blueprint nodes
Functions
Get User InfoGetuser Info ImgsHTTP GETHTTP POSTHTTP RequestHTTP Request (w/ bearer token)Make Patreon Auth URIOpen URLParse API Token InfoPerform AuthenticationPerform Authenticatin (UMG)Refresh API Token
Structs
API Token InfoPatreon Tier InfoPatreon Tier Info (w/ Images)Patreon User InfoPatreon User Info (w/ Images)
Pages
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Blueprint Functions
Pages
- Perform Authentication
- Perform Authentication (UMG Browser)
- Refresh API Token
- Get User Info
- Get User Info (w/ images)
- Get Pledge History
- Get Pledge History After
- HTTP Request
- HTTP Request (with bearer token)
- HTTP GET
- HTTP POST
- Make Patreon Auth URI
- Open URL
- Parse API Token Info
- Parse Campaign Info
- Copy To Clipboard
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: PerformAuthentication
Performs OAuth login to Patreon and requests the user's consent to share data with your application using the user's default web browser.
The returned access token can be used to make additional requests to the Patreon API, e.g. to obtain information about the authenticated user and their pledges to determine if specific in-game content should be unlocked for them.
Inputs
-
Client IDstringYour Patreon app
client_id. -
Client SecretstringPatreon app
client-secret.OPTIONAL, leave empty if not using a
client_secret. -
Callback Routestring[optional]The URL to request the authentication callback at. Must match the redirect URI you set in your patreon app config. -
Callback Portint[optional]The port to listen on for the authentication callback. Must match the redirect URI you set in your patreon app config. -
Scope OverridesString[optional]By default only theidentityscope will be requested. If you need more specify them here. See here for more details
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the authentication process continues in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the async action if you decide you actually don't need the results before it has completed.
-
On Complete
When the authentication process has been completed successfully, execution will flow from this pin.
Token Infoshould be valid and can be used at this point. -
On Fail
If the authentication process fails for any reason, execution will flow from this pin. You can use this to display an error to the user, prompt them to try again, etc.
Token Infowill be invalid and should not be used! -
Token InfoAPI Token InfoThe user's API access token. This is required for other functions which interact with the Patreon API.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: PerformAuthentication (UMG Browser)
Performs OAuth login to Patreon and requests the user's consent to share data with your application using a UMG WebBrowser widget, so they can complete the entire process without leaving the game.
The returned access token can be used to make additional requests to the Patreon API, e.g. to obtain information about the authenticated user and their pledges to determine if specific in-game content should be unlocked for them.
Inputs
-
Browser WidgetWeb BrowserUMG Web Browser widget you want the login page to be shown in.
-
Client IDStringYour Patreon app
client_id. -
Client SecretStringPatreon app
client-secret.OPTIONAL, leave empty if not using a
client_secret. -
Callback RouteString[optional]The URL to request the authentication callback at. Must match the redirect URI you set in your patreon app config. -
Callback PortInteger[optional]The port to listen on for the authentication callback. Must match the redirect URI you set in your patreon app config. -
Scope OverridesString[optional]By default only theidentityscope will be requested. If you need more specify them here. See here for more details
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the authentication process continues in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the async action if you decide you actually don't need the results before it has completed.
-
On Complete
When the authentication process has been completed successfully, execution will flow from this pin.
Token Infoshould be valid and can be used at this point. -
On Fail
If the authentication process fails for any reason, execution will flow from this pin. You can use this to display an error to the user, prompt them to try again, etc.
Token Infowill be invalid and should not be used! -
Token InfoAPI Token InfoThe user's API access token. This is required for other functions which interact with the Patreon API.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Refresh API Token
| C++ Impl | URefreshAPITokenAsyncAction |
|---|
If an access token expires, this node can be used to handle the token refresh process and obtain
a new access token without requiring the user to login again. This requires that you have saved the Refresh Token which was
obtained along with the original access token.
Inputs
-
Token InfoAPI Token InfoToken to refresh
-
Client IDStringYour Patreon app
client_id. -
Client SecretStringPatreon app
client-secret.OPTIONAL, leave empty if not using a
client_secret.
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the authentication process continues in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the async action if you decide you actually don't need the results before it has completed.
-
On Complete
When the refresh process has been completed successfully, execution will flow from this pin.
Token Infoshould be valid and can be used at this point. -
On Fail
If the authentication process fails for any reason, execution will flow from this pin. You can use this to display an error to the user, prompt them to login to Patreon again, etc.
Token Infowill be invalid and should not be used! -
Token InfoAPI Token InfoThe new API access token.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Get User Info
| C++ Impl | UGetPatreonUserInfoAsyncAction |
|---|
Retrieves information about a Patreon user. Can be used to check if they are subscribed to a specific tier in order to unlock content, display information about their subscription, etc.
Requires an access token obtained by some authentication method.
Inputs
-
Token InfoAPI Token InfoThe user's API access token. Usually obtained via oauth.
-
Campaign IDString[
OPTIONAL] If set, results will be filtered to only include data associated with the specified campaign ID. If you override the default Scopes passed to PerformAuthentication then you may receive information about multiple campaigns the user has pledged to. Setting this parameter to your campaign ID will ensure all unrelated data is automatically ignored and discarded.
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the authentication process continues in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the async action if you decide you actually don't need the results before it has completed.
-
On Complete
When the user's data has been successfully fetched, execution will flow from this pin.
User Infoshould be valid and can be used at this point. -
On Fail
If the process fails for any reason, execution will flow from this pin. You can use this to display an error to the user, prompt them to try again, etc.
User Infowill be invalid and should not be used! -
User InfoPatreon User InfoInformation about the user and their subscription status. Will only be valid via the
On Completeexecution pin.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Get User Info (w/ images)
| C++ Struct | UGetPatreonUserInfoImgAsyncAction |
|---|
Fetches information about the user and their subscriptions, AND downloads any associated images (e.g. their avatar image) and makes them available as a texture which can be used in UMG. This is a little bit slower than Get User Info because we may need to make several additional requests to download the images, but once this action completes you can be sure that all related images are available and ready to use.
If any user or tier does not have an associated image (e.g. because you never created a header image for your tiers) then
we will not make any additional requests for them and the textures will be null.
Inputs
-
Token InfoAPI Token InfoThe user's API access token. Usually obtained via oauth.
-
Campaign IDString[
OPTIONAL] If set, results will be filtered to only include data associated with the specified campaign ID. If you override the default Scopes passed to PerformAuthentication then you may receive information about multiple campaigns the user has pledged to. Setting this parameter to your campaign ID will ensure all unrelated data is automatically ignored and discarded.
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the authentication process continues in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the async action if you decide you actually don't need the results before it has completed.
-
On Complete
When the user's data has been successfully fetched, execution will flow from this pin.
User Infoshould be valid and can be used at this point. -
On Fail
If the process fails for any reason, execution will flow from this pin. You can use this to display an error to the user, prompt them to try again, etc.
User Infowill be invalid and should not be used! -
User InfoPatreon User Info ImgsInformation about the user and their subscription status.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Get Pledge History
Fetches a user's pledge history. This can be used to check if they were previously pledged to a tier (even if they may have since unsubscribed), find out when they started their subscription to their current tier, etc.
Inputs
-
Token InfoAPI Token InfoThe user's API access token. Usually obtained via oauth.
-
Discard UnpaidBoolIf true, pledge events with invalid payment states (e.g. declined payments) will not be included in the results
-
Campaign IDStringIf not empty, will only process pledge events with a matching campaign ID and discard others
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the request is processing in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the async action if you decide you actually don't need the results before it has completed.
-
On Complete
When the user's data has been successfully fetched, execution will flow from this pin.
Pledge Historyshould be valid and can be used at this point. -
On Fail
If the process fails for any reason, execution will flow from this pin. You can use this to display an error to the user, prompt them to try again, etc.
Pledge Historywill be invalid and should not be used! -
Pledge HistoryPatreon Pledge HistoryThe user's pledge history
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Get Pledge History After
Fetches a user's pledge history after a specified date. If you are only interested in a small recent time range you may want to use this to avoid processing unneeded pledge history entries later (e.g. when searching for a previously-pledged tier). It is recommended to still request a little more than you need (e.g. if you are only interested in pledges in June you may want to request pledges starting in May to capture cases where a user started their pledge on May 30 and was entitled to that tier during June).
Inputs
-
Token InfoAPI Token InfoThe user's API access token. Usually obtained via oauth.
-
Start DateDate TimePledge events with timestamps earlier than this date will not be included in the results
-
Discard UnpaidBoolIf true, pledge events with invalid payment states (e.g. declined payments) will not be included in the results
-
Campaign IDStringIf not empty, will only process pledge events with a matching campaign ID and discard others
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the request is processing in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the async action if you decide you actually don't need the results before it has completed.
-
On Complete
When the user's data has been successfully fetched, execution will flow from this pin.
Pledge Historyshould be valid and can be used at this point. -
On Fail
If the process fails for any reason, execution will flow from this pin. You can use this to display an error to the user, prompt them to try again, etc.
Pledge Historywill be invalid and should not be used! -
Pledge HistoryPatreon Pledge HistoryThe user's pledge history
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: HTTP Request
| C++ Impl | UHTTPRequestAction |
|---|
A generic HTTP request. Can be used to fetch web pages, content from REST APIs (e.g. to obtain Patreon data not currently supported by the other nodes), etc.
Inputs
-
URIStringURI to request.
-
VerbStringHTTP method, e.g.
GET,POST,PUT, etc. -
PayloadStringAdditional payload data to include with the request. How this is handled depends on
Verb.For example, if
VerbisGET, then the payload will be appended to the URI as URL params. If theVerbisPOST, the payload will be included in the request body. -
HeadersMap of
StringstoStringsOptional. Any entries included here will be added to the headers of the request.
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the authentication process continues in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the request if you decide you actually don't need the results before it has completed.
-
On Complete
When the request has completed successfully, execution will flow from this pin.
-
On Fail
If the authentication process fails for any reason, execution will flow from this pin.
-
Response CodeIntegerThe HTTP response code the request returned.
-
Response StringStringThe response content as a string.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: HTTP Request (with bearer token)
| C++ Impl | UHTTPRequestAction |
|---|
This is equivalent to the basic HTTP Request, but it will automatically add the Authorization header
required for requests with a bearer token (e.g., the requests to the Patreon API). It's a small convenience compared to
always including this header in your requests.
Inputs
-
URIStringURI to request.
-
VerbStringHTTP method, e.g.
GET,POST,PUT, etc. -
PayloadStringAdditional payload data to include with the request. How this is handled depends on
Verb.For example, if
VerbisGET, then the payload will be appended to the URI as URL params. If theVerbisPOST, the payload will be included in the request body. -
Access TokenStringThe access token to use for request authorization, e.g. the
Access Tokenfrom API Token Info. -
HeadersMap of
StringstoStringsOptional. Any entries included here will be added to the headers of the request. Including additional headers here will not affect the
Authorizationheader automatically added to the request.
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the authentication process continues in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the request if you decide you actually don't need the results before it has completed.
-
On Complete
When the request has completed successfully, execution will flow from this pin.
-
On Fail
If the authentication process fails for any reason, execution will flow from this pin.
-
Response CodeIntegerThe HTTP response code the request returned.
-
Response StringStringThe response content as a string.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: HTTP GET
| C++ Impl | UHTTPRequestAction |
|---|
Performs a basic HTTP GET request without any other options.
Inputs
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the authentication process continues in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the request if you decide you actually don't need the results before it has completed.
-
On Complete
When the request has completed successfully, execution will flow from this pin.
-
On Fail
If the authentication process fails for any reason, execution will flow from this pin.
-
Response CodeIntegerThe HTTP response code the request returned.
-
Response StringStringThe response content as a string.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: HTTP POST
| C++ Impl | UHTTPRequestAction |
|---|
Performs an HTTP POST request.
Inputs
-
URIStringURI to request.
-
PayloadStringOptional. Additional POST data to include in the request.
-
HeadersMap of
StringstoStringsOptional. Additional HTTP headers to include in the request.
Outputs
-
Main Execution Pin (at the top)
Execution will immediately continue from this pin while the authentication process continues in the background. Do not use execution flowing from this pin to check for the results, they aren't ready yet!
-
Async ActionThis is a reference to the action running in the background. You can use this to cancel the request if you decide you actually don't need the results before it has completed.
-
On Complete
When the request has completed successfully, execution will flow from this pin.
-
On Fail
If the authentication process fails for any reason, execution will flow from this pin.
-
Response CodeIntegerThe HTTP response code the request returned.
-
Response StringStringThe response content as a string.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Make Patreon Auth URI
Constructs a URI to the Patreon login/consent page.
This is the page the user must visit in order to authenticate with Patreon and generate a new access token.
Inputs
-
Client IDStringYou patreon app
Client ID -
Callback URIStringThe URI the user's browser should redirect to after authenticating with Patreon. This must match the
Redirect URIset in your Patreon app settings. -
Custom ScopesString[
OPTIONAL] If set, will override the Scopes requested during authentication. By default, only theidentityscope is requested. This is sufficient for most use cases, but if you need additional information or plan to perform your own custom queries against the API, you can set the scopes you need here. -
IdStringAn optional string which will be appended to the login URI. After authentication, this string will be included in the callback to
Callback URI. This can be used to match the response to a specific request, associate a non-Patreon user ID with a new user's access token, etc.
Outputs
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Open URL
| C++ Impl | UNBPatreonAPIClientBPLibrary |
|---|
Opens a given URL in the user's default web browser.
Inputs
Outputs
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Parse API Token Info
| C++ Impl | UNBPatreonAPIClientBPLibrary |
|---|
Parses an API Token Info from a JSON String.
It is expected that the JSON string will be of the form:
{
"access_token" : <single use token>,
"refresh_token" : <single use token>,
"expires_in" : <token lifetime duration>,
"scope" : <token scopes>,
"token_type" : "Bearer"
}
Inputs
Outputs
-
Token InfoAPI Token InfoThe parsed token, if the input string could be parsed.
-
SuccessboolTrueif the parsing was successful, otherwiseFalse. If this value isFalse,Token Infoshould not be used and will be invalid.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Parse Campaign Info
| C++ Impl | UNBPatreonAPIClientBPLibrary |
|---|
Parses a JSON string containing information about a creator's campaign (as returned from the /campaigns endpoint)
Inputs
Outputs
-
Campaign IDStringThe ID of the parsed campaign
-
TiersArray of
Patreon Tier InfoAll of the tiers associated with the campaign.
-
SuccessboolTrueif the parsing was successful, otherwiseFalse. If this value isFalse,Campaign IDandTiersshould not be used and will be invalid.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Function: Copy to Clipboard
| C++ Impl | UNBPatreonAPIClientBPLibrary |
|---|
Copies the given string to the user's clipboard
Inputs
Outputs
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Pages
- API Token Info
- Patreon Pledge Event
- Patreon Pledge History
- Patreon User Info
- Patreon User Info Imgs
- Patreon Tier Info
- Patreon Tier Info Imgs
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Struct: API Token Info
| C++ Struct | FAPITokenInfo |
|---|
Stores an API access token and related information
Properties
-
Access TokenStringAccess token used to make authenticated requests (e.g. retrieve user identity info). This is usually obtained via oath.
-
RefreshTokenStringWhen the
Access Tokenexpires, this token can be used to request a new access token without requiring the user to login again. -
ScopesStringThe scopes
Access Tokenis allowed to access. This may differ from the scopes which were requested during authentication. -
TokenLifetimeTimeSpanThe time (in seconds) after
TokenReceivedthat theAccess Tokenis valid. -
TokenReceivedDateTimeThe time (UTC)
Access TokenandRefresh Tokenwere received. This is used to check if theAccess Tokenis still valid before attempting to use it.
Functions
-
Is API Token Valid
Checks if an API token is valid.
This verifies that the
Access Tokenfield is set, and that the token has not yet expired.
Inputs
-
TokenAPI Token InfoThe token to check
Returns
Trueif the token is valid and can be used, otherwise,False. -
-
Has API Token Expired
Checks if an API token has expired.
Compares the current time to the time the token was received + the token's lifetime. Tokens are typically valid for ~30 days.
Inputs
-
TokenAPI Token InfoThe token to check
Returns
Trueif the token is expired and needs to be replaced/refreshed, otherwise,False. -
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Struct: Patreon Pledge Event
| C++ Struct | FPatreonPledgeEvent |
|---|
Contains information about when a user changed their pledge status.
See: https://docs.patreon.com/#pledge-event
Properties
-
Amount CentsInt64Amount (in the currency with which the user paid) of the underlying event.
-
Currency CodeStringISO code of the currency of the event (may not be the same currency as your campaign)
-
DateDateTimeThe timestamp at which the event occurred
-
Payment StatusStringStatus of underlying payment. One of:
PaidDeclinedDeletedPendingRefundedFraudRefunded by PatreonOtherPartially RefundedFree Trial<empty> -
Pledge Payment StatusStringThe payment status of the pledge. One of:
validqueuedpendingdeclinedfrauddisabled<empty> -
Tier IDStringID of the tier associated with this pledge. May be empty.
-
Tier TitleStringTitle of the tier associated with this pledge. May be empty.
-
TypeStringEvent type. One of:
pledge_startpledge_upgradepledge_downgradepledge_deletesubscription -
BenefitsArray of
StringIf any benefits are associated with this tier, their Titles are included here.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Struct: Patreon Pledge History
| C++ Struct | FPatreonPledgeHistory |
|---|
Contains information about when a user changed their pledge status.
Properties
-
Pledge HistoryArray of
Patreon Pledge EventCollection of pledge events for a single user. Expected to be sorted according to date.
Functions
-
Pledged To Tier After (by ID)
Checks if the user was pledged to the specified tier at any time after a provided date.
Inputs
-
Pledge HistoryPatreon Pledge HistoryThe pledge history to search
-
Tier IdStringThe ID of the tier to check
-
DateDateTimeThe minimum date that should be considered.
Outputs
-
Return ValueBoolTrue if the user was pledged to the specified tier after the given date.
-
-
Pledged To Tier After (by Title)
Checks if the user was pledged to the specified tier at any time after a provided date.
-
Pledge HistoryPatreon Pledge HistoryThe pledge history to search
Inputs
-
Tier NameStringThe Title of the tier to check
-
DateDateTimeThe minimum date that should be considered.
Outputs
-
Return ValueBoolTrue if the user was pledged to the specified tier after the given date.
-
-
Pledged To Tier Before (by ID)
Checks if the user was pledged to the specified tier at any time before a provided date.
Inputs
-
Pledge HistoryPatreon Pledge HistoryThe pledge history to search
-
Tier IdStringThe ID of the tier to check
-
DateDateTimeThe maximum date that should be considered.
Outputs
-
Return ValueBoolTrue if the user was pledged to the specified tier before the given date.
-
-
Pledged To Tier Before (by Title)
Checks if the user was pledged to the specified tier at any time before a provided date.
Inputs
-
Pledge HistoryPatreon Pledge HistoryThe pledge history to search
-
Tier NameStringThe Title of the tier to check
-
DateDateTimeThe minimum date that should be considered.
Outputs
-
Return ValueBoolTrue if the user was pledged to the specified tier before the given date.
-
-
Pledged To Tiers After
Returns the titles of the tier(s) the user was pledged to after the given date.
Inputs
-
Pledge HistoryPatreon Pledge HistoryThe pledge history to search
-
DateDateTimeThe minimum date that should be considered.
Outputs
-
Return ValueArray of
StringAll of the titles of the tiers the user was pledged to after the given date.
-
-
Pledged To Tiers Before
Returns the titles of the tier(s) the user was pledged to before a given date.
Inputs
-
Pledge HistoryPatreon Pledge HistoryThe pledge history to search
-
DateDateTimeThe maximum date that should be considered.
Outputs
-
Return ValueArray of
StringAll of the titles of the tiers the user was pledged to before the given date.
-
-
Pledged To Tiers During
Returns the titles of the tier(s) the user was pledged to during the given month, if any. If the user did not have a subscription during the given month, returns an empty list.
Inputs
-
Pledge HistoryPatreon Pledge HistoryThe pledge history to search
-
YearIntegerThe year to check
-
MonthIntegerThe the month in
Yearto check
Outputs
-
Return ValueArray of
StringAll of the titles of the tiers the user was pledged to during the given month.
-
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Struct: Patreon User Info
| C++ Struct | FPatreonUserInfo |
|---|
Stores information related to a user and their subscription(s).
Properties
-
First NameStringTher user's first name (may be empty).
-
Last NameStringTher user's last name (may be empty).
-
Full NameStringThe user's full name (usually the combination of
First NameandLast Namebut may be different). -
Vanity NameStringThe user's preferred nickname, if they have set one (may be empty).
-
Image URLStringA URL pointing to the user's avatar image
-
Patron StatusStringIndicates the user's current pledge status for your campaign.
Value Meaning active_patronThey are currently subscribed to your campaign declined_patronThey have attempted to subscribe, but payment failed former_patronThey used to subscribe, but currently do not empty This user has never subscribed to your campaign before -
Campaign Lifetime Support CentsStringThe total amount of money this user has ever contributed to this campaign, in cents.
Can be used to unlock content for users only after reaching specific subscription thresholds. NOTE: Gifted subscriptions will not increase this value!
-
Currently Entitled Amount CentsStringThe amount of money this user is currently entitled to, e.g. their current pledge amount, in cents.
This can be used to unlock content based on how much money they are contributing rather than checking which tier they belong to.
-
TiersArray of
Patreon Tier InfoA list of all the tiers this user is currently entitled to with their subscription. This will often include multiple entries even if they have only pledged to a single tier, as pledging to a higher tier can include all tiers below it.
-
Can See NSFWBoolIf
true, then this user has enabled NSFW content in their Patreon account. -
Is CreatorBoolIf
true, then this user is also the creator of the campaign!If you are testing this plugin with your creator account, then this will always be
true, and you may see some other differences when using that account vs. a regular subscriber account (e.g., the creator typically has no entitled tiers, the scopes enabled on your access token after logging in may be different, etc.).This property is mainly here to allow for a sanity check in cases like that, but you could also use it to make a 'creator-only' test mode, for example if you are unlocking certain content at certain tiers you could set ALL content to unlock for the creator account to let you test the unlocked behavior of everything everywhere all at once.
Functions
-
Has Benefit
Checks if a given user is entitled to a specific benefit/reward.
Will search all benefits of all tiers a user is entitled to.
Inputs
-
User InfoPatreon User InfoThe user to check
-
Benefit NameStringThe name/title of the benefit/reward to check for.
Case-insensitive.
Returns
True, if any tier the user is entitled to includes the specified benefit. Otherwise,False. -
-
Has Tier (By Title)
Checks if a given user is entitled to a specific tier.
Inputs
-
User InfoPatreon User InfoThe user to check
-
Tier NameStringThe name/title of the tier to check for.
Case-insensitive.
Returns
True, if any tier matches the name specified. Otherwise,False. -
-
Has Tier (By ID)
Checks if a given user is entitled to a specific tier.
Inputs
-
User InfoPatreon User InfoThe user to check
-
Tier IdStringThe ID of the tier to check for.
Case-sensitive.
Returns
True, if any tier matches the name specified. Otherwise,False. -
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Struct: Patreon User Info Imgs
| C++ Struct | FPatreonUserInfoImgs |
|---|
Stores information related to a user and their subscription(s).
Includes images (e.g. the user's avatar) as usable textures rather than URLs, so they can be directly added to the UI.
Properties
-
First NameStringTher user's first name (may be empty).
-
Last NameStringTher user's last name (may be empty).
-
Full NameStringThe user's full name (usually the combination of
First NameandLast Namebut may be different). -
Vanity NameStringThe user's preferred nickname, if they have set one (may be empty).
-
Avatar ImageTexture 2DDynamicThe user's avatar image, can be used directly in UMG to display it.
-
Patron StatusStringIndicates the user's current pledge status for your campaign.
Value Meaning active_patronThey are currently subscribed to your campaign declined_patronThey have attempted to subscribe, but payment failed former_patronThey used to subscribe, but currently do not empty This user has never subscribed to your campaign before -
Campaign Lifetime Support CentsStringThe total amount of money this user has ever contributed to this campaign, in cents.
Can be used to unlock content for users only after reaching specific subscription thresholds. NOTE: Gifted subscriptions will not increase this value!
-
Currently Entitled Amount CentsStringThe amount of money this user is currently entitled to, e.g. their current pledge amount, in cents.
This can be used to unlock content based on how much money they are contributing rather than checking which tier they belong to.
-
TiersArray of
Patreon Tier Info ImgsA list of all the tiers this user is currently entitled to with their subscription. This will often include multiple entries even if they have only pledged to a single tier, as pledging to a higher tier can include all tiers below it.
-
Can See NSFWBoolIf
true, then this user has enabled NSFW content in their Patreon account. -
Is CreatorBoolIf
true, then this user is also the creator of the campaign!If you are testing this plugin with your creator account, then this will always be
true, and you may see some other differences when using that account vs. a regular subscriber account (e.g., the creator typically has no entitled tiers, the scopes enabled on your access token after logging in may be different, etc.).This property is mainly here to allow for a sanity check in cases like that, but you could also use it to make a 'creator-only' test mode, for example if you are unlocking certain content at certain tiers you could set ALL content to unlock for the creator account to let you test the unlocked behavior of everything everywhere all at once.
Functions
-
Has Benefit
Checks if a given user is entitled to a specific benefit/reward.
Will search all benefits of all tiers a user is entitled to.
Inputs
-
User InfoPatreon User InfoThe user to check
-
Benefit NameStringThe name/title of the benefit/reward to check for.
Case-insensitive.
Returns
True, if any tier the user is entitled to includes the specified benefit. Otherwise,False. -
-
Has Tier
Checks if a given user is entitled to a specific tier.
Inputs
-
User InfoPatreon User InfoThe user to check
-
Tier NameStringThe name/title of the tier to check for.
Case-insensitive.
Returns
True, if any tier matches the name specified. Otherwise,False. -
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Struct: Patreon Tier Info
| C++ Struct | FPatreonTierInfo |
|---|
Stores information about a specific pledge tier.
Properties
-
Amount CentsInt64The price of this tier, in USD cents
-
IdStringThe ID of this tier
-
TitleStringThe tier title you set in Patreon
-
DescriptionStringThe tier description you set in Patreon
-
Image URLStringIf the tier has a header image set in Patreon, this will contain the URL to that image.
-
URLStringThe URL of the tier, itself. Can be used to link to the pledge page.
-
BenefitsArray of
StringIf any benefits are associated with this tier, their Titles are included here.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
BP Struct: Patreon Tier Info Imgs
| C++ Struct | FPatreonTierInfoImgs |
|---|
Stores information about a specific pledge tier.
Includes tier header images as textures ready to use in UMG.
Properties
-
Amount CentsInt64The price of this tier, in USD cents
-
IdStringThe ID of this tier
-
TitleStringThe tier title you set in Patreon
-
DescriptionStringThe tier description you set in Patreon
-
Tier imageTexture 2DDynamicThe tier header image, if there is one, as a ready-to-use texture.
If no image could be found, this will be
null. -
URLStringThe URL of the tier, itself. Can be used to link to the pledge page.
-
BenefitsArray of
StringIf any benefits are associated with this tier, their Titles are included here.
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
C++ API Reference
Structs
FAPITokenInfoFPatreonPledgeEventFPatreonPledgeHistoryFPatreonTierInfoFPatreonTierInfoImgsFPatreonUserInfoFPatreonUserInfoImgs
Classes
FNBPatreonAPIClientModuleUGetPatreonUserInfoAsyncActionUGetPatreonUserInfoImgAsyncActionUGetPatreonUserPledgesAsyncActionUHTTPRequestActionUNBPatreonAPIClientBPLibraryUPerformAuthenticationAsyncActionURefreshAPITokenAsyncAction
Delegates
FGetPatreonUserInfoAsyncActionEventFGetPatreonUserInfoAsyncActionFailedEventFGetPatreonUserInfoImgAsyncActionEventFGetPatreonUserInfoImgAsyncActionFailedEventFGetPatreonUserPledgesAsyncActionEventFGetPatreonUserPledgesAsyncActionFailedEventFHTTPRequestActionEventFPerformAuthenticationAsyncActionEventFPerformAuthenticationAsyncActionFailedEventFRefreshAPITokenAsyncActionEventFRefreshAPITokenAsyncActionFailedEvent
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Structs
FAPITokenInfoFPatreonPledgeEventFPatreonPledgeHistoryFPatreonTierInfoFPatreonTierInfoImgsFPatreonUserInfoFPatreonUserInfoImgs
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Struct: FAPITokenInfo
// APITokenInfo.h : 11
struct NBPATREONAPICLIENT_API FAPITokenInfo;
Reflection-enabled
Specifiers:
- BlueprintType
Stores an API access token and related information.
Properties
-
AccessTokenpublic: FString AccessToken;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
Access token used to make authenticated requests (e.g. retrieve user identity info). This is usually obtained via oath. -
RefreshTokenpublic: FString RefreshToken;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
When the AccessToken expires, this token can be used to request a new access token without requiring the user to login again. -
Scopespublic: FString Scopes;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
The scopes AccessToken is allowed to access. This may differ from the scopes which were requested during authentication. -
TokenLifetimepublic: FTimespan TokenLifetime;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
The time (in seconds) after TokenReceived that the AccessToken is valid. If `FDateTime::Now() - (TokenReceived + TokenLifetime)` is < 0, the **`Self::AccessToken`** has expired. -
TokenReceivedpublic: FDateTime TokenReceived;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
The time (UTC) AccessToken and RefreshToken were received. This is used to check if the AccessToken is still valid before attempting to use it.
Constructors
-
FAPITokenInfo// APITokenInfo.h : 51 public: FAPITokenInfo(); -
FAPITokenInfo// APITokenInfo.h : 53 public: FAPITokenInfo( FString accessToken, FString refreshToken, int64 lifetime, FString scopes );
Arguments
-
accessTokenFString accessToken -
refreshTokenFString refreshToken -
lifetimeint64 lifetime -
scopesFString scopes
-
Methods
-
HasTokenExpired// APITokenInfo.h : 63 public: bool HasTokenExpired() const; -
IsValid// APITokenInfo.h : 70 public: bool IsValid() const;Checks that there is an access token which has not yet expired. Does not check the refresh token.
Returns
-
bool
-
-
RemainingLifetime// APITokenInfo.h : 58 public: FTimespan RemainingLifetime() const;
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Struct: FPatreonPledgeEvent
// PatreonPledgeEvent.h : 14
struct NBPATREONAPICLIENT_API FPatreonPledgeEvent;
Reflection-enabled
Specifiers:
- BlueprintType
Contains information about when a user changed their pledge status.
See: https://docs.patreon.com/#pledge-event
Properties
-
AmountCentspublic: int64 AmountCents;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|User Info
Amount (in the currency with which the user paid) of the underlying event -
CurrencyCodepublic: FString CurrencyCode;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|User Info
ISO code of the currency of the event (may not be the same currency as your campaign) -
Datepublic: FDateTime Date;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|User Info
The timestamp at which the event occurred -
PaymentStatuspublic: FString PaymentStatus;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|User Info
Status of underlying payment. One of: - `Paid` - `Declined` - `Deleted` - `Pending` - `Refunded` - `Fraud` - `Refunded by Patreon` - `Other` - `Partially Refunded` - `Free Trial` - ` ` -
PledgePaymentStatuspublic: FString PledgePaymentStatus;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|User Info
The payment status of the pledge. One of: - `queued` - `pending` - `valid` - `declined` - `fraud` - `disabled` - ` ` -
TierIdpublic: FString TierId;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|User Info
ID of the tier associated with this pledge. May be empty. -
TierTitlepublic: FString TierTitle;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|User Info
Title of the tier associated with this pledge. May be empty. -
Typepublic: FString Type;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|User Info
Event type. One of: - `pledge_start` - `pledge_upgrade` - `pledge_downgrade` - `pledge_delete` - `subscription`
Constructors
-
FPatreonPledgeEvent// PatreonPledgeEvent.h : 19 public: FPatreonPledgeEvent(); -
FPatreonPledgeEvent// PatreonPledgeEvent.h : 28 public: FPatreonPledgeEvent( const TSharedPtr<FJsonObject> pledgeEventEntry );Construct FPatreonPledgeEvent from a JSON string. Populates any fields it can find in the provided JSON. If the provided JSON string cannot be parsed for any reason, the result will be uninitialized.
Arguments
-
pledgeEventEntryconst TSharedPtr<FJsonObject> pledgeEventEntry
-
Methods
-
IsPaid// PatreonPledgeEvent.h : 33 public: bool IsPaid() const; -
operator <// PatreonPledgeEvent.h : 35 public: bool operator <( const FPatreonPledgeEvent& other ) const;
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Struct: FPatreonPledgeHistory
// PatreonPledgeHistory.h : 14
struct NBPATREONAPICLIENT_API FPatreonPledgeHistory;
Reflection-enabled
Specifiers:
- BlueprintType
Contains information about when a user changed their pledge status.
Properties
-
PledgeHistorypublic: TArray<FPatreonPledgeEvent> PledgeHistory;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|User Info
Collection of pledge events for a single user. Expected to be sorted according to date.
Constructors
-
FPatreonPledgeHistory// PatreonPledgeHistory.h : 19 public: FPatreonPledgeHistory(); -
FPatreonPledgeHistory// PatreonPledgeHistory.h : 31 public: FPatreonPledgeHistory( const FString& json, const FDateTime& MinimumDate, bool DiscardUnpaid, const FString& CampaignID = TEXT("") );Construct FPatreonPledgeHistory from a JSON string. Populates any fields it can find in the provided JSON. If the provided JSON string cannot be parsed for any reason, the result will be uninitialized.
Arguments
-
jsonconst FString& jsonJSON string containing pledge history
-
MinimumDateconst FDateTime& MinimumDateEntries in json with earlier dates will be discarded
-
DiscardUnpaidbool DiscardUnpaidIf true, entries with invalid payment status (e.g. failed payments) will be discarded
-
CampaignIDconst FString& CampaignID = TEXT("")If not empty, entries which do not match the given campaign ID will be discarded
-
Methods
-
PledgedToTierAfter// PatreonPledgeHistory.h : 55 public: bool PledgedToTierAfter( const FString& tier, const FDateTime& date, bool byTierId ) const;Checks if the user was pledged to the specified tier at any time after a provided date.
Arguments
-
tierconst FString& tierThe tier to search for
-
dateconst FDateTime& dateThe minimum date that should be considered
-
byTierIdbool byTierIdIf true,
tierwill be interpreted as a Tier ID, otherwise as a Tier Title
Returns
-
bool
-
-
PledgedToTierBefore// PatreonPledgeHistory.h : 63 public: bool PledgedToTierBefore( const FString& tier, const FDateTime& date, bool byTierId ) const;Checks in the user pledged to the specified tier at any time before a provided date.
Arguments
-
tierconst FString& tierThe tier to search for
-
dateconst FDateTime& dateThe maximum date that should be considered
-
byTierIdbool byTierIdIf true,
tierwill be interpreted as a Tier ID, otherwise as a Tier Title
Returns
-
bool
-
-
PledgedToTiersAfter// PatreonPledgeHistory.h : 42 public: TArray<FString> PledgedToTiersAfter( const FDateTime& date ) const; -
PledgedToTiersBefore// PatreonPledgeHistory.h : 47 public: TArray<FString> PledgedToTiersBefore( const FDateTime& date ) const; -
PledgedToTiersDuring// PatreonPledgeHistory.h : 37 public: TArray<FString> PledgedToTiersDuring( const int32 year, const int32 month ) const;
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Struct: FPatreonTierInfo
// PatreonTierInfo.h : 15
struct NBPATREONAPICLIENT_API FPatreonTierInfo;
Reflection-enabled
Specifiers:
- BlueprintType
Represents basic information about a pledged tier.
This can be used to show the user information about the benefits or content they are now able to unlock, or just to check which content should be unlocked behind the scenes.
Properties
-
AmountCentspublic: int64 AmountCents;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|Tier
The price of this tier, in USD cents -
Benefitspublic: TArray<FString> Benefits;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
List of benefits this tier provides. If you have multiple tiers which provide the same benefit, it may be more straightforward to simply check if any tier contains a particular benefit to unlock content rather than checking for multiple tiers at once.
-
Descriptionpublic: FString Description;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
Short description of the tier, may be empty -
Idpublic: FString Id;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
The ID of this tier -
ImageURLpublic: FString ImageURL;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
URL of the tier's main image (if it has one). For convenience,
FPatreonTierInfoImgsdirectly includes the image as a texture instead. -
Titlepublic: FString Title;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
The name of this tier -
URLpublic: FString URL;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
URL of the tier, e.g. to provide a pledge link
Constructors
-
FPatreonTierInfo// PatreonTierInfo.h : 20 public: FPatreonTierInfo();
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Struct: FPatreonTierInfoImgs
// PatreonTierInfoImgs.h : 14
struct NBPATREONAPICLIENT_API FPatreonTierInfoImgs;
Reflection-enabled
Specifiers:
- BlueprintType
Provides the same information as FPatreonTierInfo, but rather than containing
URLs to images the images are stored directly as Textures.
Properties
-
AmountCentspublic: int64 AmountCents;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreaonAPIClient|Tier
The price of this tier, in USD cents -
Benefitspublic: TArray<FString> Benefits;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
List of benefits this tier provides. If you have multiple tiers which provide the same benefit, it may be more straightforward to simply check if any tier contains a benefit to unlock content rather than checking for multiple tiers at once.
-
Descriptionpublic: FString Description;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
Short description of the tier, may be empty -
Idpublic: FString Id;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
The ID of this tier -
TierImagepublic: UTexture2DDynamic* TierImage;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
Tier's main image as a texture, can be directly used in a UMG widget. -
Titlepublic: FString Title;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
The name of this tier -
URLpublic: FString URL;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Tier
URL of the tier, e.g. to provide a pledge link
Constructors
-
FPatreonTierInfoImgs// PatreonTierInfoImgs.h : 20 public: FPatreonTierInfoImgs(); -
FPatreonTierInfoImgs// PatreonTierInfoImgs.h : 25 public: FPatreonTierInfoImgs( const FPatreonTierInfo& info );
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Struct: FPatreonUserInfo
// PatreonUserInfo.h : 19
struct NBPATREONAPICLIENT_API FPatreonUserInfo;
Reflection-enabled
Specifiers:
- BlueprintType
Contains basic information about a user obtained from the Patreon API. This is meant as a convenience to cover the information most applications might need(e.g.to display to the user their pledge status or to unlock specific content based on the tiers they've pledged to). If any information you need about a user is not included here, you can still extract that information manually from an API request or submit a feature request for this plugin to nbpsup@gmail.com
Properties
-
CampaignLifetimeSupportCentspublic: int64 CampaignLifetimeSupportCents;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
The total amount of money this user has ever contributed to this campaign, in cents. Can be used to unlock content for users only after reaching specific subscription thresholds. NOTE: Gifted subscriptions will not increase this value!
-
CanSeeNSFWpublic: bool CanSeeNSFW;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
Whether or not the user has enabled NSFW content on their Patreon profile -
CurrentlyEntitledAmountCentspublic: int64 CurrentlyEntitledAmountCents;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
The amount of money this user is currently entitled to, e.g. their current pledge amount, in cents. This can be used to unlock content based on how much money they are contributing rather than checking which tier they belong to.
-
FirstNamepublic: FString FirstName;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
-
FullNamepublic: FString FullName;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
-
ImageURLpublic: FString ImageURL;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
URL of the user's avatar image -
IsCreatorpublic: bool IsCreator;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
Whether or not the current user is also the creator of a campaign. -
LastNamepublic: FString LastName;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
-
PatronStatuspublic: FString PatronStatus;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
Can be one of: active_patron: They are currently subscribed to a campaigndeclined_patron: They have attempted to subscribe, but payment failed!!former_patron: They used to subscribe, but currently do not<empty>: They have never subscribed before
-
Tierspublic: TArray<FPatreonTierInfo> Tiers;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
A list of all tiers this user is entitled to. In many cases this will include not just the specific tier they have pledged to, but also any lower tiers. -
URLpublic: FString URL;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
URL of the user's profile -
VanityNamepublic: FString VanityName;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
If set, represents the user's preferred nickname
Constructors
-
FPatreonUserInfo// PatreonUserInfo.h : 27 public: FPatreonUserInfo();Empty constructor does not provide any default values.
-
FPatreonUserInfo// PatreonUserInfo.h : 35 public: FPatreonUserInfo( const FString& json, const FString& CampaignID = TEXT("") );Constructs FPatreonUserInfo from a JSON string. Populates any fields it can find in the provided JSON. If the provided json string cannot be parsed for any reason, the result will be uninitialized.
Arguments
-
jsonconst FString& json -
CampaignIDconst FString& CampaignID = TEXT("")
-
Methods
-
GetCampaignID// PatreonUserInfo.h : 47 public: static FString GetCampaignID( const TSharedPtr<FJsonObject> relationshipEntry );Attempts to find a field 'campaign.data.id' in the given JSON object.
Arguments
-
relationshipEntryconst TSharedPtr<FJsonObject> relationshipEntryObject to begin searching from.
Returns
-
FStringThe Campaign ID if one was false, otherwise an empty string.
-
-
HasBenefit// PatreonUserInfo.h : 69 public: bool HasBenefit( const FString& benefitName ) const;Convenience method to check if this user is entitled to a particular benefit. Will check all tiers the user is pledged to.
Arguments
-
benefitNameconst FString& benefitNameName of the benefit to check for, case-insensitive
Returns
-
boolTrue if the user is entitled to the given benefit
-
-
HasTier// PatreonUserInfo.h : 54 public: bool HasTier( const FString& tierName ) const; -
HasTierId// PatreonUserInfo.h : 61 public: bool HasTierId( const FString& tierId ) const; -
ParseTier// PatreonUserInfo.h : 40 public: static FPatreonTierInfo ParseTier( const TSharedPtr<FJsonObject> tierEntry, const TSharedPtr<FJsonObject> tierattributes );Parses tier information from JSON
Arguments
-
tierEntryconst TSharedPtr<FJsonObject> tierEntry -
tierattributesconst TSharedPtr<FJsonObject> tierattributes
Returns
-
FPatreonTierInfo
-
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Struct: FPatreonUserInfoImgs
// PatreonUserInfoImgs.h : 16
struct NBPATREONAPICLIENT_API FPatreonUserInfoImgs;
Reflection-enabled
Specifiers:
- BlueprintType
Contains the same information as FPatreonUserInfo, but instead of including
URLs to images will include the actual images as a Texture2D.
Properties
-
AvatarImagepublic: UTexture2DDynamic* AvatarImage;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
User's avatar -
CampaignLifetimeSupportCentspublic: int64 CampaignLifetimeSupportCents;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
The total amount of money this user has ever contributed to this campaign, in cents. Can be used to unlock content for users only after reaching specific subscription thresholds. NOTE: Gifted subscriptions will not increase this value!
-
CanSeeNSFWpublic: bool CanSeeNSFW;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
Whether or not the user has enabled NSFW content on their Patreon profile -
CurrentlyEntitledAmountCentspublic: int64 CurrentlyEntitledAmountCents;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
The amount of money this user is currently entitled to, e.g. their current pledge amount, in cents. This can be used to unlock content based on how much money they are contributing rather than checking which tier they belong to.
-
FirstNamepublic: FString FirstName;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
-
FullNamepublic: FString FullName;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
-
IsCreatorpublic: bool IsCreator;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
Whether or not the current user is also the creator of a campaign. -
LastNamepublic: FString LastName;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
-
PatronStatuspublic: FString PatronStatus;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
Can be one of: active_patron: They are currently subscribed to a campaigndeclined_patron: They have attempted to subscribe, but were declinedformer_patron: They used to subscribe, but currently do notnull: They have never subscribed before
-
Tierspublic: TArray<FPatreonTierInfoImgs> Tiers;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
A list of all tiers this user is entitled to. In many cases this will include not just the specific tier they have pledged to, but also any lower tiers. -
URLpublic: FString URL;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
URL of the user's profile -
VanityNamepublic: FString VanityName;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|User Info
If set, represents the user's preferred nickname
Constructors
-
FPatreonUserInfoImgs// PatreonUserInfoImgs.h : 21 public: FPatreonUserInfoImgs(); -
FPatreonUserInfoImgs// PatreonUserInfoImgs.h : 23 public: FPatreonUserInfoImgs( const FPatreonUserInfo& info );
Methods
-
HasBenefit// PatreonUserInfoImgs.h : 45 public: bool HasBenefit( const FString& benefitName ) const;Convenience method to check if this user is entitled to a particular benefit. Will check all tiers the user is pledged to.
Arguments
-
benefitNameconst FString& benefitNameName of the benefit to check for, case-insensitive
Returns
-
boolTrue if the user is entitled to the given benefit
-
-
HasTier// PatreonUserInfoImgs.h : 30 public: bool HasTier( const FString& tierName ) const; -
HasTierId// PatreonUserInfoImgs.h : 37 public: bool HasTierId( const FString& tierId ) const;
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Classes
FNBPatreonAPIClientModuleUGetPatreonUserInfoAsyncActionUGetPatreonUserInfoImgAsyncActionUGetPatreonUserPledgesAsyncActionUHTTPRequestActionUNBPatreonAPIClientBPLibraryUPerformAuthenticationAsyncActionURefreshAPITokenAsyncAction
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Class: FNBPatreonAPIClientModule
// NBPatreonAPIClient.h : 9
class FNBPatreonAPIClientModule
: public IModuleInterface;
Methods
-
ShutdownModule// NBPatreonAPIClient.h : 14 public: virtual void ShutdownModule() override; -
StartupModule// NBPatreonAPIClient.h : 13 public: virtual void StartupModule() override;
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Class: UGetPatreonUserInfoAsyncAction
// GetPatreonUserInfoAsyncAction.h : 21
class NBPATREONAPICLIENT_API UGetPatreonUserInfoAsyncAction
: public UCancellableAsyncAction;
Reflection-enabled
Retrieves information about a Patreon user. Can be used to check if they are subscribed to a specific tier in order to unlock content, display information about their subscription, etc.
Requires an access token obtained by some authentication method.
Properties
-
OnCompletepublic: FGetPatreonUserInfoAsyncActionEvent OnComplete;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event fired when the task completes successfully -
OnFailpublic: FGetPatreonUserInfoAsyncActionFailedEvent OnFail;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event fired if the task fails for any reason
Methods
-
Activate// GetPatreonUserInfoAsyncAction.h : 54 public: virtual void Activate() override;Starts the task
-
Cancel// GetPatreonUserInfoAsyncAction.h : 59 public: virtual void Cancel() override;Can be called to cancel the task and prevent callbacks from being called
-
GetPatreonUserInfoAsyncAction// GetPatreonUserInfoAsyncAction.h : 36 public: static UGetPatreonUserInfoAsyncAction* GetPatreonUserInfoAsyncAction( const UObject* WorldContext, FAPITokenInfo TokenInfo, const FString CampaignID = TEXT("") );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient
Meta Specifiers:
- DisplayName = Get User Info
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
Retrieves information about the user corresponding to a specific access token.
Will fail if the access token is empty, invalid, or expired.
Arguments
-
WorldContextconst UObject* WorldContext -
TokenInfoFAPITokenInfo TokenInfoToken information for the user
-
CampaignIDconst FString CampaignID = TEXT("")[OPTIONAL] If set, results will be filtered to only include data associated with the specified campaign ID.
Returns
-
UGetPatreonUserInfoAsyncAction*
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Class: UGetPatreonUserInfoImgAsyncAction
// GetPatreonUserInfoImgAsyncAction.h : 26
class NBPATREONAPICLIENT_API UGetPatreonUserInfoImgAsyncAction
: public UCancellableAsyncAction;
Reflection-enabled
Retrieves information about a Patreon user, including their avatar image and any images for their pledged tiers.
Can be used to check if they are subscribed to a specific tier in order to unlock content, display information about their subscription, etc.
Requires an access token obtained by some authentication method.
Properties
-
OnCompletepublic: FGetPatreonUserInfoImgAsyncActionEvent OnComplete;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event fired when the task completes successfully -
OnFailpublic: FGetPatreonUserInfoImgAsyncActionFailedEvent OnFail;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event fired if the task fails for any reason
Methods
-
Activate// GetPatreonUserInfoImgAsyncAction.h : 61 public: virtual void Activate() override;Starts the task
-
Cancel// GetPatreonUserInfoImgAsyncAction.h : 66 public: virtual void Cancel() override;Can be called to cancel the task and prevent callbacks from being called
-
GetPatreonUserInfoImgAsyncAction// GetPatreonUserInfoImgAsyncAction.h : 43 public: static UGetPatreonUserInfoImgAsyncAction* GetPatreonUserInfoImgAsyncAction( const UObject* WorldContext, FAPITokenInfo TokenInfo, const FString CampaignID = TEXT("") );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient
Meta Specifiers:
- DisplayName = Get User Info (w/ images)
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
Retrieves information about the user corresponding to a specific access token, AND fetches any relevant images, e.g. their avatar and images from any pledged tiers.
Will fail if the access token is empty, invalid, or expired.
Arguments
-
WorldContextconst UObject* WorldContext -
TokenInfoFAPITokenInfo TokenInfoToken information for the user
-
CampaignIDconst FString CampaignID = TEXT("")[OPTIONAL] If set, results will be filtered to only include data associated with the specified campaign ID.
Returns
-
UGetPatreonUserInfoImgAsyncAction*
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Class: UGetPatreonUserPledgesAsyncAction
// GetPatreonUserPledgesAsyncAction.h : 20
class NBPATREONAPICLIENT_API UGetPatreonUserPledgesAsyncAction
: public UCancellableAsyncAction;
Reflection-enabled
Properties
-
OnCompletepublic: FGetPatreonUserPledgesAsyncActionEvent OnComplete;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event invoked when pledge history is successfully retrieved -
OnFailpublic: FGetPatreonUserPledgesAsyncActionFailedEvent OnFail;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event invoked if fetching the pledge history fails for any reason
Methods
-
Activate// GetPatreonUserPledgesAsyncAction.h : 67 public: virtual void Activate() override;Starts the task
-
Cancel// GetPatreonUserPledgesAsyncAction.h : 72 public: virtual void Cancel() override;Can be called to cancel the task and prevent callbacks from being called
-
GetPatreonUserPledgesAfterAsyncAction// GetPatreonUserPledgesAsyncAction.h : 49 public: static UGetPatreonUserPledgesAsyncAction* GetPatreonUserPledgesAfterAsyncAction( const UObject* WorldContext, const FAPITokenInfo TokenInfo, const FDateTime& StartDate, bool DiscardUnpaid = true, const FString CampaignID = TEXT("") );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Pledge History
Meta Specifiers:
- DisplayName = Get Pledge History After
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
Fetches a user's pledge history after a specified date. If you are only interested in a small recent time range you may wan to use this to avoid processing unneeded pledge history entries later (e.g. when searching for a previously-pledged tier). It is recommended to still request a little more than you need (e.g. if you are only interested in pledges in June you may want to request pledges starting in May to capture cases where a user started their pledge on May 30 and was entitled to that tier during June).
Arguments
-
WorldContextconst UObject* WorldContext -
TokenInfoconst FAPITokenInfo TokenInfoValid TokenInfo from the user to fetch pledge history for
-
StartDateconst FDateTime& StartDatePledge events with timestamps earlier than this date will not be included in the results
-
DiscardUnpaidbool DiscardUnpaid = trueIf true, pledge events with invalid payment states (e.g. declined payments) will not be included in the results
-
CampaignIDconst FString CampaignID = TEXT("")If not empty, will only process pledge events with a matching campaign ID and discard others
Returns
-
UGetPatreonUserPledgesAsyncAction*
-
GetPatreonUserPledgesAsyncAction// GetPatreonUserPledgesAsyncAction.h : 34 public: static UGetPatreonUserPledgesAsyncAction* GetPatreonUserPledgesAsyncAction( const UObject* WorldContext, const FAPITokenInfo TokenInfo, bool DiscardUnpaid = true, const FString CampaignID = TEXT("") );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Pledge History
Meta Specifiers:
- DisplayName = Get Pledge History
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
Fetches a user's pledge history. This can be used to check if they were previously pledged to a tier (even if they may have since unsubscribed), find out when they started their subscription to their current tier, etc.
Arguments
-
WorldContextconst UObject* WorldContext -
TokenInfoconst FAPITokenInfo TokenInfoValid TokenInfo from the user to fetch pledge history for
-
DiscardUnpaidbool DiscardUnpaid = trueIf true, pledge events with invalid payment states (e.g. declined payments) will not be included in the results
-
CampaignIDconst FString CampaignID = TEXT("")If not empty, will only process pledge events with a matching campaign ID and discard others
Returns
-
UGetPatreonUserPledgesAsyncAction*
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Class: UHTTPRequestAction
// HTTPRequestAction.h : 15
class NBPATREONAPICLIENT_API UHTTPRequestAction
: public UCancellableAsyncAction;
Reflection-enabled
Helper to make common HTTP requests a little easier and expose them to blueprints.
Properties
-
OnCompletepublic: FHTTPRequestActionEvent OnComplete;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event fired when the request completes successfully -
OnFailpublic: FHTTPRequestActionEvent OnFail;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event fired if the request fails for any reason
Methods
-
Activate// HTTPRequestAction.h : 83 public: virtual void Activate() override;Starts the task
-
Cancel// HTTPRequestAction.h : 88 public: virtual void Cancel() override;Can be called to cancel the task and prevent callbacks from being called
-
HTTPGetAsyncAction// HTTPRequestAction.h : 54 public: static UHTTPRequestAction* HTTPGetAsyncAction( const UObject* WorldContext, FString URI );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|HTTP
Meta Specifiers:
- DisplayName = HTTP GET
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
HTTP GET Request
Arguments
-
WorldContextconst UObject* WorldContext -
URIFString URIURI to request
Returns
-
UHTTPRequestAction*
-
HTTPPostAsyncAction// HTTPRequestAction.h : 65 public: static UHTTPRequestAction* HTTPPostAsyncAction( const UObject* WorldContext, FString URI, FString Payload, TMap<FString, FString> Headers );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|HTTP
Meta Specifiers:
- DisplayName = HTTP POST
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
HTTP POST Request
Arguments
-
WorldContextconst UObject* WorldContext -
URIFString URIURI to request
-
PayloadFString PayloadPOST data to include
-
HeadersTMap<FString, FString> Headers(optional) Custom headers to include with request
Returns
-
UHTTPRequestAction*
-
HTTPRequestAsyncAction// HTTPRequestAction.h : 30 public: static UHTTPRequestAction* HTTPRequestAsyncAction( const UObject* WorldContext, FString URI, FString Verb, FString Payload, TMap<FString, FString> Headers );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|HTTP
Meta Specifiers:
- DisplayName = HTTP Request
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
Generic HTTP request
Arguments
-
WorldContextconst UObject* WorldContext -
URIFString URIURI to request
-
VerbFString VerbHTTP method, e.g.
GETorPOST -
PayloadFString Payload(optional) additional payload to include with the request (depends on verb)
-
HeadersTMap<FString, FString> Headers(optional) Custom headers to include with request
Returns
-
UHTTPRequestAction*
-
HTTPRequestWithTokenAsyncAction// HTTPRequestAction.h : 45 public: static UHTTPRequestAction* HTTPRequestWithTokenAsyncAction( const UObject* WorldContext, FString URI, FString Verb, FString Payload, FString AccessToken, TMap<FString, FString> Headers );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|HTTP
Meta Specifiers:
- DisplayName = HTTP Request (with bearer token)
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
HTTP Request with a bearer token.
This will automatically set the
Authorizationheader toBearer <AccessToken>.
Arguments
-
WorldContextconst UObject* WorldContext -
URIFString URIURI to request
-
VerbFString VerbHTTP method, e.g.
GETorPOST -
PayloadFString Payload(optional) additional payload to include with the request (depends on verb)
-
AccessTokenFString AccessTokenAccess token to use
-
HeadersTMap<FString, FString> Headers(optional) Custom headers to include with request
Returns
-
UHTTPRequestAction*
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Class: UNBPatreonAPIClientBPLibrary
// NBPatreonAPIClientBPLibrary.h : 12
class UNBPatreonAPIClientBPLibrary
: public UBlueprintFunctionLibrary;
Reflection-enabled
Methods
-
CopyToClipboard// NBPatreonAPIClientBPLibrary.h : 182 public: static void CopyToClipboard( const FString str );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Utils
Meta Specifiers:
- DisplayName = Copy to Clipboard
- Keywords = NBPatreonAPIClient
Copies the given string to the user's clipboard
Arguments
-
strconst FString str
-
HasBenefit// NBPatreonAPIClientBPLibrary.h : 67 public: static bool HasBenefit( const FPatreonUserInfo& UserInfo, const FString BenefitName );
Reflection-enabled
Specifiers:
- BlueprintPure
- BlueprintCallable
- Category = NBPatreonAPIClient|User Info
Meta Specifiers:
- DisplayName = Has Benefit
- Keywords = NBPatreonAPIClient
Checks if the given User is entitled to a specific benefit/reward
Arguments
-
UserInfoconst FPatreonUserInfo& UserInfoUser to check
-
BenefitNameconst FString BenefitName
Returns
-
bool
-
HasBenefit2// NBPatreonAPIClientBPLibrary.h : 75 public: static bool HasBenefit2( const FPatreonUserInfoImgs& UserInfo, const FString BenefitName );
Reflection-enabled
Specifiers:
- BlueprintPure
- BlueprintCallable
- Category = NBPatreonAPIClient|User Info
Meta Specifiers:
- DisplayName = Has Benefit
- Keywords = NBPatreonAPIClient
Checks if the given User is entitled to a specific benefit/reward
Arguments
-
UserInfoconst FPatreonUserInfoImgs& UserInfoUser to check
-
BenefitNameconst FString BenefitName
Returns
-
bool
-
HasTier// NBPatreonAPIClientBPLibrary.h : 35 public: static bool HasTier( const FPatreonUserInfo& UserInfo, const FString TierName );
Reflection-enabled
Specifiers:
- BlueprintPure
- BlueprintCallable
- Category = NBPatreonAPIClient|User Info
Meta Specifiers:
- DisplayName = Has Tier (by Title)
- Keywords = NBPatreonAPIClient
Checks if the given User is pledged to a specific tier.
Arguments
-
UserInfoconst FPatreonUserInfo& UserInfoUser to check
-
TierNameconst FString TierNameName of tier, case-insensitive
Returns
-
bool
-
HasTier2// NBPatreonAPIClientBPLibrary.h : 43 public: static bool HasTier2( const FPatreonUserInfoImgs& UserInfo, const FString TierName );
Reflection-enabled
Specifiers:
- BlueprintPure
- BlueprintCallable
- Category = NBPatreonAPIClient|User Info
Meta Specifiers:
- DisplayName = Has Tier (by Title)
- Keywords = NBPatreonAPIClient
Checks if the given User is pledged to a specific tier.
Arguments
-
UserInfoconst FPatreonUserInfoImgs& UserInfoUser to check
-
TierNameconst FString TierNameName of tier, case-insensitive
Returns
-
bool
-
HasTierById// NBPatreonAPIClientBPLibrary.h : 51 public: static bool HasTierById( const FPatreonUserInfo& UserInfo, const FString TierId );
Reflection-enabled
Specifiers:
- BlueprintPure
- BlueprintCallable
- Category = NBPatreonAPIClient|User Info
Meta Specifiers:
- DisplayName = Has Tier (by ID)
- Keywords = NBPatreonAPIClient
Checks if the given User is pledged to a specific tier.
Arguments
Returns
-
bool
-
HasTierById2// NBPatreonAPIClientBPLibrary.h : 59 public: static bool HasTierById2( const FPatreonUserInfoImgs& UserInfo, const FString TierId );
Reflection-enabled
Specifiers:
- BlueprintPure
- BlueprintCallable
- Category = NBPatreonAPIClient|User Info
Meta Specifiers:
- DisplayName = Has Tier (by ID)
- Keywords = NBPatreonAPIClient
Checks if the given User is pledged to a specific tier.
Arguments
Returns
-
bool
-
HasTokenExpired// NBPatreonAPIClientBPLibrary.h : 21 public: static bool HasTokenExpired( const FAPITokenInfo& token );
Reflection-enabled
Specifiers:
- BlueprintPure
- BlueprintCallable
- Category = NBPatreonAPIClient
Meta Specifiers:
- DisplayName = Has API Token Expired
- Keywords = NBPatreonAPIClient
Checks if a token's lifetime has expired.
Arguments
-
tokenconst FAPITokenInfo& token
Returns
-
bool
-
IsTokenValid// NBPatreonAPIClientBPLibrary.h : 27 public: static bool IsTokenValid( const FAPITokenInfo& token );
Reflection-enabled
Specifiers:
- BlueprintPure
- BlueprintCallable
- Category = NBPatreonAPIClient
Meta Specifiers:
- DisplayName = Is API Token Valid
- Keywords = NBPatreonAPIClient
Checks if the access token is present and not yet expired
Arguments
-
tokenconst FAPITokenInfo& token
Returns
-
bool
-
OpenURL// NBPatreonAPIClientBPLibrary.h : 176 public: static void OpenURL( const FString URL );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|HTTP
Meta Specifiers:
- DisplayName = Open URL
- Keywords = NBPatreonAPIClient
Opens a given URL in the user's default web browser
Arguments
-
URLconst FString URL
-
ParseCampaignInfo// NBPatreonAPIClientBPLibrary.h : 170 public: static bool ParseCampaignInfo( FString JsonStr, FString& CampaignID, TArray<FPatreonTierInfo>& Tiers );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Campaign
Meta Specifiers:
- DisplayName = Parse Campaign Info
- Keywords = NBPatreonAPIClient
Parses a JSON string containing a creator's campaign information.
Arguments
-
JsonStrFString JsonStrThe JSON string to parse
-
CampaignIDFString& CampaignIDThe creator's campaign ID
-
TiersTArray<FPatreonTierInfo>& Tiers
Returns
-
boolTrue if JsonStr could be parsed, otherwise false. If this is false, CampaignID and Tiers should not be used.
-
ParseTokenInfo// NBPatreonAPIClientBPLibrary.h : 160 public: static bool ParseTokenInfo( FString JsonStr, FAPITokenInfo& TokenInfo );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient
Meta Specifiers:
- DisplayName = Parse API Token Info
- Keywords = NBPatreonAPIClient
Parses a JSON string containing an access token, as provided by the Patreon API. This expects a JSON string of the form:
{ "access_token": <single use token>, "refresh_token" : <single use token>, "expires_in" : <token lifetime duration>, "scope" : <token scopes>, "token_type" : "Bearer" }
Arguments
-
JsonStrFString JsonStrThe JSON string to parse
-
TokenInfoFAPITokenInfo& TokenInfoThe parsed TokenInfo object
Returns
-
boolTrue if the JsonStr could be parsed, otherwise False. If this returns False, TokenInfo should not be used.
-
PledgedToTierAfter// NBPatreonAPIClientBPLibrary.h : 110 public: static bool PledgedToTierAfter( const FPatreonPledgeHistory& PledgeHistory, const FString& tierName, const FDateTime& date );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Pledge History
Meta Specifiers:
- DisplayName = Pledged To Tier After (by Title)
- Keywords = NBPatreonAPIClient
Checks if a user was pledged to a specific tier at any time after a given date (inclusive)
Arguments
-
PledgeHistoryconst FPatreonPledgeHistory& PledgeHistoryThe pledge history to search
-
tierNameconst FString& tierNameThe Title of the Tier to search for
-
dateconst FDateTime& dateThe minimum date to consider
Returns
-
boolTrue if the user pledged to the given tier after the given date
-
PledgedToTierAfter2// NBPatreonAPIClientBPLibrary.h : 120 public: static bool PledgedToTierAfter2( const FPatreonPledgeHistory& PledgeHistory, const FString& tierId, const FDateTime& date );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Pledge History
Meta Specifiers:
- DisplayName = Pledged To Tier After (by ID)
- Keywords = NBPatreonAPIClient
Checks if a user was pledged to a specific tier at any time after a given date (inclusive)
Arguments
-
PledgeHistoryconst FPatreonPledgeHistory& PledgeHistoryThe pledge history to search
-
tierIdconst FString& tierIdThe ID of the Tier to search for
-
dateconst FDateTime& dateThe minimum date to consider
Returns
-
boolTrue if the user pledged to the given tier after the given date
-
PledgedToTierBefore// NBPatreonAPIClientBPLibrary.h : 130 public: static bool PledgedToTierBefore( const FPatreonPledgeHistory& PledgeHistory, const FString& tierName, const FDateTime& date );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Pledge History
Meta Specifiers:
- DisplayName = Pledged To Tier Before (by Title)
- Keywords = NBPatreonAPIClient
Checks if a user was pledged to a specific tier at any time before a given date (inclusive)
Arguments
-
PledgeHistoryconst FPatreonPledgeHistory& PledgeHistoryThe pledge history to search
-
tierNameconst FString& tierNameThe Title of the Tier to search for
-
dateconst FDateTime& dateThe maximum date to consider
Returns
-
boolTrue if the user pledged to the given tier before the given date
-
PledgedToTierBefore2// NBPatreonAPIClientBPLibrary.h : 140 public: static bool PledgedToTierBefore2( const FPatreonPledgeHistory& PledgeHistory, const FString& tierId, const FDateTime& date );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Pledge History
Meta Specifiers:
- DisplayName = Pledged To Tier Before (by ID)
- Keywords = NBPatreonAPIClient
Checks if a user was pledged to a specific tier at any time before a given date (inclusive)
Arguments
-
PledgeHistoryconst FPatreonPledgeHistory& PledgeHistoryThe pledge history to search
-
tierIdconst FString& tierIdThe ID of the Tier to search for
-
dateconst FDateTime& dateThe maximum date to consider
Returns
-
boolTrue if the user pledged to the given tier before the given date
-
PledgedToTiersAfter// NBPatreonAPIClientBPLibrary.h : 92 public: static TArray<FString> PledgedToTiersAfter( const FPatreonPledgeHistory& PledgeHistory, const FDateTime& date );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Pledge History
Meta Specifiers:
- DisplayName = Pledged To Tiers After
- Keywords = NBPatreonAPIClient
Returns a list of all tiers a user pledged to after a given date (inclusive)
Arguments
-
PledgeHistoryconst FPatreonPledgeHistory& PledgeHistoryThe pledge history to search
-
dateconst FDateTime& dateThe minimum date to include results for
Returns
-
TArray<FString>
-
PledgedToTiersBefore// NBPatreonAPIClientBPLibrary.h : 100 public: static TArray<FString> PledgedToTiersBefore( const FPatreonPledgeHistory& PledgeHistory, const FDateTime& date );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Pledge History
Meta Specifiers:
- DisplayName = Pledged To Tiers Before
- Keywords = NBPatreonAPIClient
Returns a list of all tiers a user pledged to before a given date (inclusive)
Arguments
-
PledgeHistoryconst FPatreonPledgeHistory& PledgeHistoryThe pledge history to search
-
dateconst FDateTime& dateThe maximum date to include results for
Returns
-
TArray<FString>
-
PledgedToTiersDuring// NBPatreonAPIClientBPLibrary.h : 84 public: static TArray<FString> PledgedToTiersDuring( const FPatreonPledgeHistory& PledgeHistory, const int32 year, const int32 month );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|Pledge History
Meta Specifiers:
- DisplayName = Pledged To Tiers During
- Keywords = NBPatreonAPIClient
Returns a list of all tiers a user pledged to during a given month.
Arguments
-
PledgeHistoryconst FPatreonPledgeHistory& PledgeHistoryThe pledge history to search
-
yearconst int32 yearThe year to match
-
monthconst int32 monthThe month in the year to match
Returns
-
TArray<FString>
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Class: UPerformAuthenticationAsyncAction
// PerformAuthenticationAsyncAction.h : 42
class NBPATREONAPICLIENT_API UPerformAuthenticationAsyncAction
: public UCancellableAsyncAction;
Reflection-enabled
This action can be used to perform authentication with the Patreon API. The user's default web browser will be opened to allow them to sign in, a local HTTP server will be started to receive the authentication response from Patreon, and finally a request will be made to obtain an access token for the authenticated user.
The returned access token can be used to make additional requests to the Patreon API, e.g. to obtain information about the authenticated user and their pledges to determine if specific content should be unlocked for them.
IMPORTANT NOTE:
Because everything is being handled within the same process, using this action requires that the application have a copy of your client_id and client_secret (if you use one), both of which will be included in HTTP requests sent to Patreon from the user's computer. This means that the user may be able to extract these values either from the packaged binaries or by analyzing their network traffic during the authentication process.
NEVER use your creator token here!
Properties
-
OnCompletepublic: FPerformAuthenticationAsyncActionEvent OnComplete;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event invoked when authentication is completed successfully -
OnFailpublic: FPerformAuthenticationAsyncActionFailedEvent OnFail;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event invoked if authentication fails for any reason
Methods
-
Activate// PerformAuthenticationAsyncAction.h : 123 public: virtual void Activate() override;Starts the task
-
Cancel// PerformAuthenticationAsyncAction.h : 128 public: virtual void Cancel() override;Can be called to cancel the task and prevent callbacks from being called
-
MakeAuthURI// PerformAuthenticationAsyncAction.h : 103 public: static FString MakeAuthURI( const FString ClientID, const FString CallbackURI, const FString CustomScopes = TEXT(""), FString id = TEXT("") );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient|HTTP
Meta Specifiers:
- DisplayName = Make Patreon Auth URI
- Keywords = NBPatreonAPIClient
Constructs a URI to the Patreon login/consent page, with default minimal scopes. This should be used to allow the user to authenticate with Patreon in a web browser.
Arguments
-
ClientIDconst FString ClientIDPatreon app Client ID
-
CallbackURIconst FString CallbackURIURI to redirect the user to after successfully authenticating
-
CustomScopesconst FString CustomScopes = TEXT("")By default only authorization for the 'identity' scope will be requested. If you need additional scopes, specify them here. See here for more information
-
idFString id = TEXT("")Optional session/state/id value which will be passed back to the CallbackURI after authentication. This can be used to match a specific request to a specific response if necessary.
Returns
-
FString
-
PerformAuthenticationAsyncAction// PerformAuthenticationAsyncAction.h : 57 public: static UPerformAuthenticationAsyncAction* PerformAuthenticationAsyncAction( const UObject* WorldContext, const FString ClientID, const FString ClientSecret, const FString CallbackRoute = TEXT("/login"), const int32 CallbackPort = 8080, const FString ScopeOverrides = TEXT("") );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient
Meta Specifiers:
- DisplayName = Perform Authentication
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
Performs OAuth login to Patreon using the user's default web browser
Arguments
-
WorldContextconst UObject* WorldContext -
ClientIDconst FString ClientIDPatreon App client_id
-
ClientSecretconst FString ClientSecretPatreon App client_secret - OPTIONAL - Leave empty if not using a client_secret
-
CallbackRouteconst FString CallbackRoute = TEXT("/login")URL fragment (after hostname and port) to expect the login callback to invoke
-
CallbackPortconst int32 CallbackPort = 8080Port to listen on for the login callback
-
ScopeOverridesconst FString ScopeOverrides = TEXT("")By default only the 'identity' scope will be requested. If you need more specify them here.
Returns
-
UPerformAuthenticationAsyncAction*
-
PerformAuthenticationUMGAsyncAction// PerformAuthenticationAsyncAction.h : 82 public: static UPerformAuthenticationAsyncAction* PerformAuthenticationUMGAsyncAction( const UObject* WorldContext, UWebBrowser* BrowserWidget, const FString ClientID, const FString ClientSecret, const FString CallbackRoute = TEXT("/login"), const int32 CallbackPort = 8080, const FString ScopeOverrides = TEXT("") );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient
Meta Specifiers:
- DisplayName = Perform Authentication (UMG Browser)
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
Performs OAuth login to Patreon using a UMG WebBrowser widget. (Requires the
WebBrowserplugin to be enabled in your project)IMPORTANT NOTE:
Due to limitations of the WebBrowser widget, users will need to sign in using their e-mail address. SSO methods like "Sign in with Google" will fail because these rely on opening a second browser window.
Arguments
-
WorldContextconst UObject* WorldContext -
BrowserWidgetUWebBrowser* BrowserWidgetWidget to use to display the login page
-
ClientIDconst FString ClientIDPatreon App client_id
-
ClientSecretconst FString ClientSecretPatreon App client_secret - OPTIONAL - Leave empty if not using a client_secret
-
CallbackRouteconst FString CallbackRoute = TEXT("/login")URL fragment (after hostname and port) to expect the login callback to invoke
-
CallbackPortconst int32 CallbackPort = 8080Port to listen on for the login callback
-
ScopeOverridesconst FString ScopeOverrides = TEXT("")By default only the 'identity' scope will be requested. If you need more specify them here.
Returns
-
UPerformAuthenticationAsyncAction*
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Class: URefreshAPITokenAsyncAction
// RefreshAPITokenAsyncAction.h : 19
class NBPATREONAPICLIENT_API URefreshAPITokenAsyncAction
: public UCancellableAsyncAction;
Reflection-enabled
Refreshes an existing API access token
Properties
-
OnCompletepublic: FRefreshAPITokenAsyncActionEvent OnComplete;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event invoked when token refresh is completed successfully -
OnFailpublic: FRefreshAPITokenAsyncActionFailedEvent OnFail;
Reflection-enabled
Specifiers:
- BlueprintAssignable
Event invoked if token refresh fails for any reason
Methods
-
Activate// RefreshAPITokenAsyncAction.h : 46 public: virtual void Activate() override;Starts the task
-
Cancel// RefreshAPITokenAsyncAction.h : 51 public: virtual void Cancel() override;Can be called to cancel the task and prevent callbacks from being called
-
RefreshAPITokenAsyncAction// RefreshAPITokenAsyncAction.h : 28 public: static URefreshAPITokenAsyncAction* RefreshAPITokenAsyncAction( const UObject* WorldContext, const FAPITokenInfo TokenInfo, const FString ClientID, const FString ClientSecret );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = NBPatreonAPIClient
Meta Specifiers:
- DisplayName = Refresh API Token
- Keywords = NBPatreonAPIClient
- WorldContext = WorldContext
- BlueprintInternalUseOnly = true
Refreshes an API access token
Arguments
-
WorldContextconst UObject* WorldContext -
TokenInfoconst FAPITokenInfo TokenInfo -
ClientIDconst FString ClientID -
ClientSecretconst FString ClientSecret
Returns
-
URefreshAPITokenAsyncAction*
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegates
FGetPatreonUserInfoAsyncActionEventFGetPatreonUserInfoAsyncActionFailedEventFGetPatreonUserInfoImgAsyncActionEventFGetPatreonUserInfoImgAsyncActionFailedEventFGetPatreonUserPledgesAsyncActionEventFGetPatreonUserPledgesAsyncActionFailedEventFHTTPRequestActionEventFPerformAuthenticationAsyncActionEventFPerformAuthenticationAsyncActionFailedEventFRefreshAPITokenAsyncActionEventFRefreshAPITokenAsyncActionFailedEvent
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FGetPatreonUserInfoAsyncActionEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FGetPatreonUserInfoAsyncActionEvent,
FPatreonUserInfo UserInfo
);
// Compatible function signature
void FGetPatreonUserInfoAsyncActionEvent(
FPatreonUserInfo UserInfo
);
Parameters
-
UserInfoFPatreonUserInfo UserInfo
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FGetPatreonUserInfoAsyncActionFailedEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FGetPatreonUserInfoAsyncActionFailedEvent);
// Compatible function signature
void FGetPatreonUserInfoAsyncActionFailedEvent();
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FGetPatreonUserInfoImgAsyncActionEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FGetPatreonUserInfoImgAsyncActionEvent,
FPatreonUserInfoImgs UserInfo
);
// Compatible function signature
void FGetPatreonUserInfoImgAsyncActionEvent(
FPatreonUserInfoImgs UserInfo
);
Parameters
-
UserInfoFPatreonUserInfoImgs UserInfo
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FGetPatreonUserInfoImgAsyncActionFailedEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FGetPatreonUserInfoImgAsyncActionFailedEvent);
// Compatible function signature
void FGetPatreonUserInfoImgAsyncActionFailedEvent();
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FGetPatreonUserPledgesAsyncActionEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FGetPatreonUserPledgesAsyncActionEvent,
FPatreonPledgeHistory PledgeHistory
);
// Compatible function signature
void FGetPatreonUserPledgesAsyncActionEvent(
FPatreonPledgeHistory PledgeHistory
);
Parameters
-
PledgeHistoryFPatreonPledgeHistory PledgeHistory
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FGetPatreonUserPledgesAsyncActionFailedEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FGetPatreonUserPledgesAsyncActionFailedEvent);
// Compatible function signature
void FGetPatreonUserPledgesAsyncActionFailedEvent();
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FHTTPRequestActionEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FHTTPRequestActionEvent,
int32 ResponseCode,
FString ResponseString
);
// Compatible function signature
void FHTTPRequestActionEvent(
int32 ResponseCode,
FString ResponseString
);
Parameters
-
ResponseCodeint32 ResponseCode -
ResponseStringFString ResponseString
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FPerformAuthenticationAsyncActionEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FPerformAuthenticationAsyncActionEvent,
FAPITokenInfo TokenInfo
);
// Compatible function signature
void FPerformAuthenticationAsyncActionEvent(
FAPITokenInfo TokenInfo
);
Parameters
-
TokenInfoFAPITokenInfo TokenInfo
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FPerformAuthenticationAsyncActionFailedEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FPerformAuthenticationAsyncActionFailedEvent);
// Compatible function signature
void FPerformAuthenticationAsyncActionFailedEvent();
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FRefreshAPITokenAsyncActionEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FRefreshAPITokenAsyncActionEvent,
FAPITokenInfo TokenInfo
);
// Compatible function signature
void FRefreshAPITokenAsyncActionEvent(
FAPITokenInfo TokenInfo
);
Parameters
-
TokenInfoFAPITokenInfo TokenInfo
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com
Delegate: FRefreshAPITokenAsyncActionFailedEvent
// Delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FRefreshAPITokenAsyncActionFailedEvent);
// Compatible function signature
void FRefreshAPITokenAsyncActionFailedEvent();
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com