Upgrade Patreon Discourse Plugin to API v2

Hey folks :waving_hand:

The Patreon Discourse plugin is still using Patreon’s API v1, which has been deprecated for several years. To keep the integration working properly, it needs to be updated to use API v2.

Patreon’s API v2 is the supported version and provides equivalent functionality to v1, along with a more consistent data model and improved resource relationships.
Docs:

Key migration notes:

  • Some API calls currently using /api/oauth2/ will need to be updated to the v2 endpoints.

  • The users of the plugin will need to create new Patreon OAuth clients with v2 scopes during the migration. v1 clients aren’t compatible.

  • The data structure (e.g. campaign, member, pledge) is modeled differently in v2.

I would like to know what’s the process for these kind of updates. Happy to help with guidance on this migration.

Thanks for maintaining this integration :folded_hands:

2 likes

I wanted to follow up on this topic. Is this plugin still being actively maintained, or should we assume it is inactive and accept that the termination of the v1 API will result in the plugin no longer working?

1 like

Yes. I believe it is still actively maintained, as it’s an official plugin, has been included-in-core, and has the most recent commit only last week.

1 like

Last time we researched into this, Patreon had disbanded the team doing API v2 midway, so the API v1 would work indefinitely.

Can you link to any resources saying otherwise?

1 like

Thanks for getting back on this! Source on this - I’m an engineer on the Patreon team. Our public documentation and client creation flow have callouts about v1 deprecation. V2 has been the main API for about 5+ years, discourse is one of the last integrations that still isn’t using it.

EDIT: Feel free to DM or email (in case I don’t get notifications from discourse) if y’all need additional information.

6 likes

Hi @Falco any updates / plans updating plugin? We would like to minimize the impact of killing v1. Thanks.

3 likes

I will take a stab on updating next week. Can we get some testing credentials?

4 likes

Awesome @falco, I appreciate that! Patreon does not have public testing users. The best way I would suggest testing this would be to:

  1. Create your test account (https://www.patreon.com/login) and verify your email.
  2. Only creators are allowed to create OAuth clients. You would need to launch your creator campaign by visiting https://patreon.com/create (email has to be verified to consider the campaign launched).
  3. Create a test tier https://patreon.com/c/yourvanity/membership.
  4. You can now create the v2 api client at https://www.patreon.com/portal/registration/register-clients

To test access gating / membership features you would create a separate test account. You could then either pledge to the free tier of your test campaign or potentially grant a gifted membership from the creator.

I’m happy to respond pair up / help you over DMs next week.

1 like

I can’t get this form to enable the submit button no matter what I try

Same thing that was reported at

It is the only blocker for me to merge the change

4 likes

@Falco we shipped a fix for this earlier today, apologies! Can you try again? Also, neat - quick progress! :tada:

2 likes

Okay, this is working well on my test site, I will merge the change early Monday.

3 likes

That was quick, thanks!

Not related to a v2 upgrade, but a general ask while you are putting up this PR - could you please set the user agent to a custom value? Something like Discourse-Patreon-Plugin/vX.x? That might help us debug API issues in the future and identify clients. For the v1 deprecation I saw a bunch of Faraday UAs and that’s how I landed on Discourse being one of the remaining v1 apps.

2 likes

Good idea, added to the PR.

3 likes