Usage & Examples

Before Getting Started

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

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

1. Simple & Automatic

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

Simple Setup

2. Custom

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

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

Custom Setup


Running the examples

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

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

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

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

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

Plugins/NBPatreonAPIClient Content/Examples/UI/WBP_PatreonLogin_WebBrowser

Plugins/NBPatreonAPIClient Content/Examples/UI/WBP_PatreonLogin_UMGBrowser

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

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

It is up to you to decide how 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






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.

  1. Navigate to: https://www.patreon.com/portal/registration/register-clients

  2. Click the Create Client button

  3. You must set the Client API Version to 2, and fill in the App Name, Description, and Redirect URIs fields.

    The value used in the Redirect URIs field 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/login by default. This can be customized, though.

    If you plan to use your own web service to proxy the authentication, then the Redirect URI should 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 Secret string, 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:

  1. You open the Patreon login and consent page for your user (either using their default web browser or the UMG Web Browser widget).
  2. 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 matching Redirect URI, e.g. if you set Callback Route to /patreon and Callback Port to 9999, you must update the settings in Patreon to include a Redirect URI of http://localhost:9999/patreon.

    The Callback Route MUST start with "/" and be longer than just "/" but can otherwise be anything you want.

    The Callback Port MUST be a positive integer, and unless you plan to use port 80 should be larger than 1024

  3. 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 Token on behalf of the user.
  4. 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.
  5. 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

Authentication & Checking for a tier

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:

Custom Auth Page

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:

Custom Fetch User Info




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.

Pledge History Usage Example






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

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

Structs

Pages






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

Blueprint Functions

Pages






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

BP Function: PerformAuthentication

Perform Authentication Node


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

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 Action

    This 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 Info should 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 Info will be invalid and should not be used!

  • Token Info

    API Token Info

    The 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)

Perform Authentication (UMG Browser) Node


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

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 Action

    This 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 Info should 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 Info will be invalid and should not be used!

  • Token Info

    API Token Info

    The 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

Perform Authentication (UMG Browser) Node


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

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 Action

    This 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 Info should 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 Info will be invalid and should not be used!

  • Token Info

    API Token Info

    The 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

Get User Info Node


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 Info

    API Token Info

    The user's API access token. Usually obtained via oauth.

  • Campaign ID

    String

    [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 Action

    This 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 Info should 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 Info will be invalid and should not be used!

  • User Info

    Patreon User Info

    Information about the user and their subscription status. Will only be valid via the On Complete execution 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)

Get User Info Node


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 Info

    API Token Info

    The user's API access token. Usually obtained via oauth.

  • Campaign ID

    String

    [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 Action

    This 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 Info should 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 Info will be invalid and should not be used!

  • User Info

    Patreon User Info Imgs

    Information 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

Get Pledge History Node


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 Info

    API Token Info

    The user's API access token. Usually obtained via oauth.

  • Discard Unpaid

    Bool

    If true, pledge events with invalid payment states (e.g. declined payments) will not be included in the results

  • Campaign ID

    String

    If 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 Action

    This 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 History should 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 History will be invalid and should not be used!

  • Pledge History

    Patreon Pledge History

    The 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

Get Pledge History After Node


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 Info

    API Token Info

    The user's API access token. Usually obtained via oauth.

  • Start Date

    Date Time

    Pledge events with timestamps earlier than this date will not be included in the results

  • Discard Unpaid

    Bool

    If true, pledge events with invalid payment states (e.g. declined payments) will not be included in the results

  • Campaign ID

    String

    If 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 Action

    This 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 History should 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 History will be invalid and should not be used!

  • Pledge History

    Patreon Pledge History

    The 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

Perform Authentication (UMG Browser) Node


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

  • URI

    String

    URI to request.

  • Verb

    String

    HTTP method, e.g. GET, POST, PUT, etc.

  • Payload

    String

    Additional payload data to include with the request. How this is handled depends on Verb.

    For example, if Verb is GET, then the payload will be appended to the URI as URL params. If the Verb is POST, the payload will be included in the request body.

  • Headers

    Map of Strings to Strings

    Optional. 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 Action

    This 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 Code

    Integer

    The HTTP response code the request returned.

  • Response String

    String

    The 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)

Perform Authentication (UMG Browser) Node


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

  • URI

    String

    URI to request.

  • Verb

    String

    HTTP method, e.g. GET, POST, PUT, etc.

  • Payload

    String

    Additional payload data to include with the request. How this is handled depends on Verb.

    For example, if Verb is GET, then the payload will be appended to the URI as URL params. If the Verb is POST, the payload will be included in the request body.

  • Access Token

    String

    The access token to use for request authorization, e.g. the Access Token from API Token Info.

  • Headers

    Map of Strings to Strings

    Optional. Any entries included here will be added to the headers of the request. Including additional headers here will not affect the Authorization header 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 Action

    This 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 Code

    Integer

    The HTTP response code the request returned.

  • Response String

    String

    The 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

Perform Authentication (UMG Browser) Node


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 Action

    This 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 Code

    Integer

    The HTTP response code the request returned.

  • Response String

    String

    The 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

Perform Authentication (UMG Browser) Node


Performs an HTTP POST request.


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 Action

    This 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 Code

    Integer

    The HTTP response code the request returned.

  • Response String

    String

    The 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

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 ID

    String

    You patreon app Client ID

  • Callback URI

    String

    The URI the user's browser should redirect to after authenticating with Patreon. This must match the Redirect URI set in your Patreon app settings.

  • Custom Scopes

    String

    [OPTIONAL] If set, will override the Scopes requested during authentication. By default, only the identity scope 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.

  • Id

    String

    An 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

Open URL Node


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

Get User Info Node


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 Info

    API Token Info

    The parsed token, if the input string could be parsed.

  • Success

    bool

    True if the parsing was successful, otherwise False. If this value is False, Token Info should 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

Get User Info Node


Parses a JSON string containing information about a creator's campaign (as returned from the /campaigns endpoint)


Inputs

Outputs






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

BP Function: Copy to Clipboard

Open URL Node


Copies the given string to the user's clipboard


Inputs

  • Str

    String

    The string to put on the user's clipboard

Outputs






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

Pages






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

BP Struct: API Token Info

C++ StructFAPITokenInfo

API Token Info Node


Stores an API access token and related information


Properties

  • Access Token

    String

    Access token used to make authenticated requests (e.g. retrieve user identity info). This is usually obtained via oath.

  • RefreshToken

    String

    When the Access Token expires, this token can be used to request a new access token without requiring the user to login again.

  • Scopes

    String

    The scopes Access Token is allowed to access. This may differ from the scopes which were requested during authentication.

  • TokenLifetime

    TimeSpan

    The time (in seconds) after TokenReceived that the Access Token is valid.

  • TokenReceived

    DateTime

    The time (UTC) Access Token and Refresh Token were received. This is used to check if the Access Token is still valid before attempting to use it.

Functions

  • Is API Token Valid

    Is Valid


    Checks if an API token is valid.

    This verifies that the Access Token field is set, and that the token has not yet expired.


    Inputs

    Returns

    True if the token is valid and can be used, otherwise, False.

  • Has API Token Expired

    Is Valid


    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

    Returns

    True if 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

Patreon Pledge Event Node


Contains information about when a user changed their pledge status.

See: https://docs.patreon.com/#pledge-event


Properties

  • Amount Cents

    Int64

    Amount (in the currency with which the user paid) of the underlying event.

  • Currency Code

    String

    ISO code of the currency of the event (may not be the same currency as your campaign)

  • Date

    DateTime

    The timestamp at which the event occurred

  • Payment Status

    String

    Status of underlying payment. One of:

    Paid
    Declined
    Deleted
    Pending
    Refunded
    Fraud
    Refunded by Patreon
    Other
    Partially Refunded
    Free Trial
    <empty>
  • Pledge Payment Status

    String

    The payment status of the pledge. One of:

    valid
    queued
    pending
    declined
    fraud
    disabled
    <empty>
  • Tier ID

    String

    ID of the tier associated with this pledge. May be empty.

  • Tier Title

    String

    Title of the tier associated with this pledge. May be empty.

  • Type

    String

    Event type. One of:

    pledge_start
    pledge_upgrade
    pledge_downgrade
    pledge_delete
    subscription
  • Benefits

    Array of String

    If 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

Patreon Pledge History Node


Contains information about when a user changed their pledge status.


Properties

Functions






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

BP Struct: Patreon User Info

C++ StructFPatreonUserInfo

Patreon User Info Node


Stores information related to a user and their subscription(s).


Properties

  • First Name

    String

    Ther user's first name (may be empty).

  • Last Name

    String

    Ther user's last name (may be empty).

  • Full Name

    String

    The user's full name (usually the combination of First Name and Last Name but may be different).

  • Vanity Name

    String

    The user's preferred nickname, if they have set one (may be empty).

  • Image URL

    String

    A URL pointing to the user's avatar image

  • Patron Status

    String

    Indicates the user's current pledge status for your campaign.

    ValueMeaning
    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
    emptyThis user has never subscribed to your campaign before
  • Campaign Lifetime Support Cents

    String

    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!

  • Currently Entitled Amount Cents

    String

    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.

  • Tiers

    Array of Patreon Tier Info

    A 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 NSFW

    Bool

    If true, then this user has enabled NSFW content in their Patreon account.

  • Is Creator

    Bool

    If 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






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

BP Struct: Patreon User Info Imgs

Patreon User Info Node


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 Name

    String

    Ther user's first name (may be empty).

  • Last Name

    String

    Ther user's last name (may be empty).

  • Full Name

    String

    The user's full name (usually the combination of First Name and Last Name but may be different).

  • Vanity Name

    String

    The user's preferred nickname, if they have set one (may be empty).

  • Avatar Image

    Texture 2DDynamic

    The user's avatar image, can be used directly in UMG to display it.

  • Patron Status

    String

    Indicates the user's current pledge status for your campaign.

    ValueMeaning
    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
    emptyThis user has never subscribed to your campaign before
  • Campaign Lifetime Support Cents

    String

    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!

  • Currently Entitled Amount Cents

    String

    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.

  • Tiers

    Array of Patreon Tier Info Imgs

    A 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 NSFW

    Bool

    If true, then this user has enabled NSFW content in their Patreon account.

  • Is Creator

    Bool

    If 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






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

BP Struct: Patreon Tier Info

C++ StructFPatreonTierInfo

Patreon Tier Info Node


Stores information about a specific pledge tier.


Properties






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

BP Struct: Patreon Tier Info Imgs

Patreon User Info Node


Stores information about a specific pledge tier.

Includes tier header images as textures ready to use in UMG.


Properties






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

C++ API Reference

Structs

Classes

Delegates






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

Structs






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

  • AccessToken

    public:
    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.
  • RefreshToken

    public:
    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.
  • Scopes

    public:
    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.
  • TokenLifetime

    public:
    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.
  • TokenReceived

    public:
    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


Methods

  • HasTokenExpired

    //  APITokenInfo.h : 63
    
    public:
    bool HasTokenExpired() const;
    

    Checks if a token's lifetime has expired.


    Returns

    • bool
      
  • 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;
    

    Computes the time remaining (from now) before the token expires.


    Returns

    • FTimespan
      






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

  • AmountCents

    public:
    int64 AmountCents;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreaonAPIClient|User Info

    Amount (in the currency with which the user paid) of the underlying event
  • CurrencyCode

    public:
    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)
  • Date

    public:
    FDateTime Date;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreaonAPIClient|User Info

    The timestamp at which the event occurred
  • PaymentStatus

    public:
    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` - ``
  • PledgePaymentStatus

    public:
    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` - ``
  • TierId

    public:
    FString TierId;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreaonAPIClient|User Info

    ID of the tier associated with this pledge. May be empty.
  • TierTitle

    public:
    FString TierTitle;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreaonAPIClient|User Info

    Title of the tier associated with this pledge. May be empty.
  • Type

    public:
    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


Methods

  • IsPaid

    //  PatreonPledgeEvent.h : 33
    
    public:
    bool IsPaid() const;
    

    Checks if payment for this event is valid (not failed, declined, etc).


    Returns

    • bool
      
  • operator <

    //  PatreonPledgeEvent.h : 35
    
    public:
    bool operator <(
        const FPatreonPledgeEvent& other
    ) const;
    

    Arguments

    • other

      const FPatreonPledgeEvent& other
      

    Returns

    • bool
      






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

  • PledgeHistory

    public:
    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

    • json

      const FString& json
      

      JSON string containing pledge history

    • MinimumDate

      const FDateTime& MinimumDate
      

      Entries in json with earlier dates will be discarded

    • DiscardUnpaid

      bool DiscardUnpaid
      

      If true, entries with invalid payment status (e.g. failed payments) will be discarded

    • CampaignID

      const 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

    • tier

      const FString& tier
      

      The tier to search for

    • date

      const FDateTime& date
      

      The minimum date that should be considered

    • byTierId

      bool byTierId
      

      If true, tier will 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

    • tier

      const FString& tier
      

      The tier to search for

    • date

      const FDateTime& date
      

      The maximum date that should be considered

    • byTierId

      bool byTierId
      

      If true, tier will 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;
    

    Returns the titles of the tier(s) the user was pledged to after the given date.


    Arguments

    • date

      const FDateTime& date
      

    Returns

    • TArray<FString>
      
  • PledgedToTiersBefore

    //  PatreonPledgeHistory.h : 47
    
    public:
    TArray<FString> PledgedToTiersBefore(
        const FDateTime& date
    ) const;
    

    Returns the titles of the tier(s) the user was pledged to after the given date.


    Arguments

    • date

      const FDateTime& date
      

    Returns

    • TArray<FString>
      
  • PledgedToTiersDuring

    //  PatreonPledgeHistory.h : 37
    
    public:
    TArray<FString> PledgedToTiersDuring(
        const int32 year,
        const int32 month
    ) const;
    

    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.


    Arguments

    • year

      const int32 year
      
    • month

      const int32 month
      

    Returns

    • TArray<FString>
      






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

  • AmountCents

    public:
    int64 AmountCents;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreaonAPIClient|Tier

    The price of this tier, in USD cents
  • Benefits

    public:
    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.

  • Description

    public:
    FString Description;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|Tier

    Short description of the tier, may be empty
  • Id

    public:
    FString Id;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|Tier

    The ID of this tier
  • ImageURL

    public:
    FString ImageURL;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|Tier

    URL of the tier's main image (if it has one).

    For convenience, FPatreonTierInfoImgs directly includes the image as a texture instead.

  • Title

    public:
    FString Title;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|Tier

    The name of this tier
  • URL

    public:
    FString URL;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|Tier

    URL of the tier, e.g. to provide a pledge link

Constructors






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

  • AmountCents

    public:
    int64 AmountCents;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreaonAPIClient|Tier

    The price of this tier, in USD cents
  • Benefits

    public:
    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.

  • Description

    public:
    FString Description;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|Tier

    Short description of the tier, may be empty
  • Id

    public:
    FString Id;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|Tier

    The ID of this tier
  • TierImage

    public:
    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.
  • Title

    public:
    FString Title;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|Tier

    The name of this tier
  • URL

    public:
    FString URL;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|Tier

    URL of the tier, e.g. to provide a pledge link

Constructors






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

  • CampaignLifetimeSupportCents

    public:
    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!

  • CanSeeNSFW

    public:
    bool CanSeeNSFW;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    Whether or not the user has enabled NSFW content on their Patreon profile
  • CurrentlyEntitledAmountCents

    public:
    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.

  • FirstName

    public:
    FString FirstName;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

  • FullName

    public:
    FString FullName;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

  • ImageURL

    public:
    FString ImageURL;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    URL of the user's avatar image
  • IsCreator

    public:
    bool IsCreator;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    Whether or not the current user is also the creator of a campaign.
  • LastName

    public:
    FString LastName;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

  • PatronStatus

    public:
    FString PatronStatus;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    Can be one of:
    • active_patron: They are currently subscribed to a campaign
    • declined_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
  • Tiers

    public:
    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.
  • URL

    public:
    FString URL;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    URL of the user's profile
  • VanityName

    public:
    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

    • json

      const FString& json
      
    • CampaignID

      const 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

    • relationshipEntry

      const TSharedPtr<FJsonObject> relationshipEntry
      

      Object to begin searching from.


    Returns

    • FString
      

      The 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

    • benefitName

      const FString& benefitName
      

      Name of the benefit to check for, case-insensitive


    Returns

    • bool
      

      True if the user is entitled to the given benefit

  • HasTier

    //  PatreonUserInfo.h : 54
    
    public:
    bool HasTier(
        const FString& tierName
    ) const;
    

    Convenience method to check if this user has pledged to a specific tier


    Arguments

    • tierName

      const FString& tierName
      

      Name of the tier to check for, case-insensitive


    Returns

    • bool
      

      True if the user has pledged to the given tier

  • HasTierId

    //  PatreonUserInfo.h : 61
    
    public:
    bool HasTierId(
        const FString& tierId
    ) const;
    

    Convenience method to check if this user has pledged to a specific tier


    Arguments

    • tierId

      const FString& tierId
      

      ID of the tier to check for


    Returns

    • bool
      

      True if the user has pledged to the given tier

  • ParseTier

    //  PatreonUserInfo.h : 40
    
    public:
    static FPatreonTierInfo ParseTier(
        const TSharedPtr<FJsonObject> tierEntry,
        const TSharedPtr<FJsonObject> tierattributes
    );
    

    Parses tier information from JSON


    Arguments


    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

  • AvatarImage

    public:
    UTexture2DDynamic* AvatarImage;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    User's avatar
  • CampaignLifetimeSupportCents

    public:
    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!

  • CanSeeNSFW

    public:
    bool CanSeeNSFW;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    Whether or not the user has enabled NSFW content on their Patreon profile
  • CurrentlyEntitledAmountCents

    public:
    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.

  • FirstName

    public:
    FString FirstName;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

  • FullName

    public:
    FString FullName;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

  • IsCreator

    public:
    bool IsCreator;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    Whether or not the current user is also the creator of a campaign.
  • LastName

    public:
    FString LastName;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

  • PatronStatus

    public:
    FString PatronStatus;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    Can be one of:
    • active_patron: They are currently subscribed to a campaign
    • declined_patron: They have attempted to subscribe, but were declined
    • former_patron: They used to subscribe, but currently do not
    • null: They have never subscribed before
  • Tiers

    public:
    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.
  • URL

    public:
    FString URL;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    URL of the user's profile
  • VanityName

    public:
    FString VanityName;
    

    Reflection-enabled

    Specifiers:

    • EditAnywhere
    • BlueprintReadWrite
    • Category = NBPatreonAPIClient|User Info

    If set, represents the user's preferred nickname

Constructors


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

    • benefitName

      const FString& benefitName
      

      Name of the benefit to check for, case-insensitive


    Returns

    • bool
      

      True if the user is entitled to the given benefit

  • HasTier

    //  PatreonUserInfoImgs.h : 30
    
    public:
    bool HasTier(
        const FString& tierName
    ) const;
    

    Convenience method to check if this user has pledged to a specific tier


    Arguments

    • tierName

      const FString& tierName
      

      Name of the tier to check for, case-insensitive


    Returns

    • bool
      

      True if the user has pledged to the given tier

  • HasTierId

    //  PatreonUserInfoImgs.h : 37
    
    public:
    bool HasTierId(
        const FString& tierId
    ) const;
    

    Convenience method to check if this user has pledged to a specific tier


    Arguments

    • tierId

      const FString& tierId
      

      IDof the tier to check for


    Returns

    • bool
      

      True if the user has pledged to the given tier






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

Classes






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

  • OnComplete

    public:
    FGetPatreonUserInfoAsyncActionEvent OnComplete;
    

    Reflection-enabled

    Specifiers:

    • BlueprintAssignable

    Event fired when the task completes successfully
  • OnFail

    public:
    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

    • WorldContext

      const UObject* WorldContext
      
    • TokenInfo

      FAPITokenInfo TokenInfo
      

      Token information for the user

    • CampaignID

      const 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

  • OnComplete

    public:
    FGetPatreonUserInfoImgAsyncActionEvent OnComplete;
    

    Reflection-enabled

    Specifiers:

    • BlueprintAssignable

    Event fired when the task completes successfully
  • OnFail

    public:
    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

    • WorldContext

      const UObject* WorldContext
      
    • TokenInfo

      FAPITokenInfo TokenInfo
      

      Token information for the user

    • CampaignID

      const 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

  • OnComplete

    public:
    FGetPatreonUserPledgesAsyncActionEvent OnComplete;
    

    Reflection-enabled

    Specifiers:

    • BlueprintAssignable

    Event invoked when pledge history is successfully retrieved
  • OnFail

    public:
    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

    • WorldContext

      const UObject* WorldContext
      
    • TokenInfo

      const FAPITokenInfo TokenInfo
      

      Valid TokenInfo from the user to fetch pledge history for

    • StartDate

      const FDateTime& StartDate
      

      Pledge events with timestamps earlier than this date will not be included in the results

    • DiscardUnpaid

      bool DiscardUnpaid = true
      

      If true, pledge events with invalid payment states (e.g. declined payments) will not be included in the results

    • CampaignID

      const 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

    • WorldContext

      const UObject* WorldContext
      
    • TokenInfo

      const FAPITokenInfo TokenInfo
      

      Valid TokenInfo from the user to fetch pledge history for

    • DiscardUnpaid

      bool DiscardUnpaid = true
      

      If true, pledge events with invalid payment states (e.g. declined payments) will not be included in the results

    • CampaignID

      const 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

  • OnComplete

    public:
    FHTTPRequestActionEvent OnComplete;
    

    Reflection-enabled

    Specifiers:

    • BlueprintAssignable

    Event fired when the request completes successfully
  • OnFail

    public:
    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


    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

    • WorldContext

      const UObject* WorldContext
      
    • URI

      FString URI
      

      URI to request

    • Payload

      FString Payload
      

      POST data to include

    • Headers

      TMap<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

    • WorldContext

      const UObject* WorldContext
      
    • URI

      FString URI
      

      URI to request

    • Verb

      FString Verb
      

      HTTP method, e.g. GET or POST

    • Payload

      FString Payload
      

      (optional) additional payload to include with the request (depends on verb)

    • Headers

      TMap<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 Authorization header to Bearer <AccessToken>.


    Arguments

    • WorldContext

      const UObject* WorldContext
      
    • URI

      FString URI
      

      URI to request

    • Verb

      FString Verb
      

      HTTP method, e.g. GET or POST

    • Payload

      FString Payload
      

      (optional) additional payload to include with the request (depends on verb)

    • AccessToken

      FString AccessToken
      

      Access token to use

    • Headers

      TMap<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

    • str

      const 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

    • UserInfo

      const FPatreonUserInfo& UserInfo
      

      User to check

    • BenefitName

      const 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

    • UserInfo

      const FPatreonUserInfoImgs& UserInfo
      

      User to check

    • BenefitName

      const 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

    • UserInfo

      const FPatreonUserInfo& UserInfo
      

      User to check

    • TierName

      const FString TierName
      

      Name 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

    • UserInfo

      const FPatreonUserInfoImgs& UserInfo
      

      User to check

    • TierName

      const FString TierName
      

      Name 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

    • UserInfo

      const FPatreonUserInfo& UserInfo
      

      User to check

    • TierId

      const FString TierId
      

      ID of tier


    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

    • UserInfo

      const FPatreonUserInfoImgs& UserInfo
      

      User to check

    • TierId

      const FString TierId
      

      ID of tier


    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

    • token

      const 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

    • token

      const 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

    • URL

      const 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

    • JsonStr

      FString JsonStr
      

      The JSON string to parse

    • CampaignID

      FString& CampaignID
      

      The creator's campaign ID

    • Tiers

      TArray<FPatreonTierInfo>& Tiers
      

    Returns

    • bool
      

      True 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

    • JsonStr

      FString JsonStr
      

      The JSON string to parse

    • TokenInfo

      FAPITokenInfo& TokenInfo
      

      The parsed TokenInfo object


    Returns

    • bool
      

      True 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

    • PledgeHistory

      const FPatreonPledgeHistory& PledgeHistory
      

      The pledge history to search

    • tierName

      const FString& tierName
      

      The Title of the Tier to search for

    • date

      const FDateTime& date
      

      The minimum date to consider


    Returns

    • bool
      

      True 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

    • PledgeHistory

      const FPatreonPledgeHistory& PledgeHistory
      

      The pledge history to search

    • tierId

      const FString& tierId
      

      The ID of the Tier to search for

    • date

      const FDateTime& date
      

      The minimum date to consider


    Returns

    • bool
      

      True 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

    • PledgeHistory

      const FPatreonPledgeHistory& PledgeHistory
      

      The pledge history to search

    • tierName

      const FString& tierName
      

      The Title of the Tier to search for

    • date

      const FDateTime& date
      

      The maximum date to consider


    Returns

    • bool
      

      True 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

    • PledgeHistory

      const FPatreonPledgeHistory& PledgeHistory
      

      The pledge history to search

    • tierId

      const FString& tierId
      

      The ID of the Tier to search for

    • date

      const FDateTime& date
      

      The maximum date to consider


    Returns

    • bool
      

      True 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

    • PledgeHistory

      const FPatreonPledgeHistory& PledgeHistory
      

      The pledge history to search

    • date

      const FDateTime& date
      

      The 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

    • PledgeHistory

      const FPatreonPledgeHistory& PledgeHistory
      

      The pledge history to search

    • date

      const FDateTime& date
      

      The 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

    • PledgeHistory

      const FPatreonPledgeHistory& PledgeHistory
      

      The pledge history to search

    • year

      const int32 year
      

      The year to match

    • month

      const int32 month
      

      The 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

  • OnComplete

    public:
    FPerformAuthenticationAsyncActionEvent OnComplete;
    

    Reflection-enabled

    Specifiers:

    • BlueprintAssignable

    Event invoked when authentication is completed successfully
  • OnFail

    public:
    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

    • ClientID

      const FString ClientID
      

      Patreon app Client ID

    • CallbackURI

      const FString CallbackURI
      

      URI to redirect the user to after successfully authenticating

    • CustomScopes

      const 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

    • id

      FString 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

    • WorldContext

      const UObject* WorldContext
      
    • ClientID

      const FString ClientID
      

      Patreon App client_id

    • ClientSecret

      const FString ClientSecret
      

      Patreon App client_secret - OPTIONAL - Leave empty if not using a client_secret

    • CallbackRoute

      const FString CallbackRoute = TEXT("/login")
      

      URL fragment (after hostname and port) to expect the login callback to invoke

    • CallbackPort

      const int32 CallbackPort = 8080
      

      Port to listen on for the login callback

    • ScopeOverrides

      const 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 WebBrowser plugin 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

    • WorldContext

      const UObject* WorldContext
      
    • BrowserWidget

      UWebBrowser* BrowserWidget
      

      Widget to use to display the login page

    • ClientID

      const FString ClientID
      

      Patreon App client_id

    • ClientSecret

      const FString ClientSecret
      

      Patreon App client_secret - OPTIONAL - Leave empty if not using a client_secret

    • CallbackRoute

      const FString CallbackRoute = TEXT("/login")
      

      URL fragment (after hostname and port) to expect the login callback to invoke

    • CallbackPort

      const int32 CallbackPort = 8080
      

      Port to listen on for the login callback

    • ScopeOverrides

      const 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

  • OnComplete

    public:
    FRefreshAPITokenAsyncActionEvent OnComplete;
    

    Reflection-enabled

    Specifiers:

    • BlueprintAssignable

    Event invoked when token refresh is completed successfully
  • OnFail

    public:
    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


    Returns

    • URefreshAPITokenAsyncAction*
      






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

Delegates






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






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

  • UserInfo

    FPatreonUserInfoImgs 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






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






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






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






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