Here goes, first time this is being revealed publicly drumroll…
And if this is interesting enough we can include in the docs.
How to create widgets on behalf of creators
-
Your app’s UI asks its users for their patreon URL
-
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
-
Patreon returns JSON containing the user id:
data: {
type: 'user',
id: {their user id},
...
},
...
}
-
Your app should probably save the returned Patreon user id in your users database since it will not change
-
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