Support me on Patreon button

Here goes, first time this is being revealed publicly :slight_smile: drumroll…

And if this is interesting enough we can include in the docs.

How to create widgets on behalf of creators

  1. Your app’s UI asks its users for their patreon URL

  2. Your app code calls GET https://api.patreon.com/platform/users?filter[patreon_url]=${their patreon url} Note that only the GET value changes for each user, the GET key is static

  3. Patreon returns JSON containing the user id:

    data: {
        type: 'user',
        id: {their user id},
        ...
    },
    ...
}
  1. Your app should probably save the returned Patreon user id in your users database since it will not change

  2. When rendering the widget for a given individual creator, put this HTML snippet in their page:

<a href="https://www.patreon.com/bePatron?u={their user id}" data-patreon-widget-type="become-patron-button">Become a Patron!</a><script async src="https://cdn6.patreon.com/becomePatronButton.bundle.js"></script>

cc @david who built this a few months ago

Also cc @codebard I know this may be interesting to some of the work you’ve mentioned in the past

2 Likes