Configuring Patreon integration with Discourse

plugins

(Rafael dos Santos Silva) #1

Discourse Patreon Installation

First of all you need a working Discourse install with our official Patreon plugin.

:warning: During all the guide, swap https://forum.example.com with your forum domain.

Getting your Patreon Credentials

You can visit the Patreon Client & API Keys page and fill all the required fields. Use https://forum.example.com/auth/patreon/callback as the Redirect URIs.

Click on Create Client.
When the app appears on the page, click the arrow to expand the content:

If everything is successful you will receive a Client ID, a Client Secret and 2 tokens:


Save this token because you will need those later.

Configuring Discourse

Visit https://forum.example.com/admin/site_settings/category/plugins?filter=patreon and enable and fill all the settings.

  • Note that you must fill Patreon creator discourse username only if you are using Patreon creator account to login in Discourse through “Login with Patreon” feature. In that case it is the value of local Discourse account username. Else you can skip it.
    It is needed because Patreon creator access token will be changed whenever you login.
  • Continuing this guide you will also find the Patreon webhook secret

Running the first sync

Now that everything is set up, go to https://forum.example.com/admin/plugins/patreon and you will get a screen like this:

Let’s click on the Update Patreon Data button so we get the first batch of data from Patreon. You will never need to do this again, because the plugin runs 4 times a day in the background for you.

Clicking on the button starts a process that takes a little while (usually 30 seconds) and if everything works out you will get a message like this:

After clicking OK you will refresh the page, but now all your Patreon data will be avaliable.

You can select the automatically created patrons group on the left and $0 - All Patrons on the right and after that click on the save button. Now click on the Sync Groups button again.

Results

Now, every Patreon has a group membership on the patrons group of you forum. This includes a group flair and a badge too!

Additional Stuff

Edit the badge and the group description with links to your Patreon page so it’s easier for new members to discover how to achieve then.

WebHooks

If you want to react faster to new Patrons, changes in tier and stuff like that, you can trigger a new sync between Discourse and Patreon on every change

To do that first visit Patreon WebHooks Page and create a new webhook pointing to https://forum.example.com/patreon/webhook.

The result will be similar to this:

If necessary, switch to Off the triggers that do not interest you, then click on Send test to see this window

Click again on Send test

If the test fails you will see Status code: 403 (you will have to double check the configuration)
If the test is passed you will see Status code: 200.

Copy the webhook secret and paste it in patreon_webhook_secret setting.

That’s it.


Discourse Patreon Integration
Integrating Discourse With Patreon
Integrating Discourse With Patreon
Discourse on Azure Container Service?
Discourse Hosting - Digital Ocean vs Linode
(Vinoth Kannan) #30

Hi @RobertBrockie, can you share the error log details here


(Vinoth Kannan) #76

Yes. Else it will give you unexpected result/errors.

We will improve this error handling in future. But it’s not in my current roadmap.


(Bart) #77

The described webhooks have been deprecated. Should we continue to use them, or do we need to switch to the new hook types?


(Rafael dos Santos Silva) #78

You should continue using those.

We will adapt our plugin to use the new ones when we do a whole refresh of the Patreon API (they have a v2 API now). And they even said we will be able to create the webhooks for the users so we will be able to automate that step for everyone.


#79

whats the process for handling users who registered on discourse and patreon w/ different e-mail addresses??


(Jay Pfaffman) #80

#81

i don’t think that’s it … i.e. they want to maintain 2 separate login e-mails for patreon and discourse

did the secondary e-mail feature get removed ?


(Jay Pfaffman) #82

So they want one account, but to have discourse think that they have a different email account than patreon thinks?


(Vinoth Kannan) #83

If users neither used Patreon login nor the same email address then you have to create a custom Patrons group for them. Currently you can’t automate this process.


(Rafael dos Santos Silva) #84

Now that Discourse support multiple emails per user I wonder if he can just register a secondary email for the user in Discourse and it will work @vinothkannans :thinking:


(Vinoth Kannan) #87

This is false statement. The plugin is already working fine. I tested it with a new Patreon creator account.


(Mark Queppet) #88

I have my forum set up to where you can only log in if you are a patron. For the most part it’s working great, but it seems like people are having trouble signing in via iOS devices.

Normally, you click sign in and it then takes you to patreon to verify your credentials. Once you do that, it should send a confirmation link to your email. Once you click the link in your email it lets you log in.

However, for people on iOS when they click log in it tries to pull their Patreon info but then gives them this error: “Sorry there was an error authorizing your account. Perhaps you did not approve authorization?”

These same people are able to get it to work using their laptops/desktops. Also, my android users don’t seem to have any problems. Any suggestions here?


(Vinoth Kannan) #89

Are you using the latest version of the plugin? This is already fixed in the commit below


(Mark Queppet) #90

I don’t know… From the plugin settings it says I’m on version 2.0 - is this the latest version? If it’s not, how would I update to it? If it is… is there anything else I can do to help rectify this situation? Thank you.


(Vinoth Kannan) #91

Navigate to the URL http://forum.yoursite.com/admin/upgrade to upgrade your site with latest version of the plugin.