# "Connect with Patreon" (General approach)

**URL:** <https://www.patreondevelopers.com/t/connect-with-patreon-general-approach/8953>\
**Category:** Friendly Help\
**Created:** [June 24, 2024, 6:14pm UTC](https://www.patreondevelopers.com/t/connect-with-patreon-general-approach/8953 "2024-06-24T18:14:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andymel](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@andymel](https://www.patreondevelopers.com/u/andymel)\
**Post date:** [June 24, 2024, 6:14pm UTC](https://www.patreondevelopers.com/t/connect-with-patreon-general-approach/8953/1 "2024-06-24T18:14:35Z")

</div>

**Context**  
I added a “Connect with Patreon” button to my php website (not wordpress).  
The OAuth flow works, users can allow the connection and I get the tokens and can retrieve all necessary userdata.

I have mutliple questions regarding staying up to date. I see three technical approaches:

1. save the refresh\_token of the connecting user and use it to get a new access\_token once I need to know if the user is still my supporter. I guess a cron job can refresh the refresh\_tokens that were not used for a month so that they stay valid if the user is not active.
2. register a webhook to get updates from patreon instead of asking the patreon API on demand. On each event I update my “local patreon cache”.
3. Do the requests on demand like in point 1 but with creator permissions.  
3a. Use creator tokens. Keeping the tokens valid in a cron job as in (1).  
3b. Use a service account with a secret that does not expire.

**Question 1**  
Any better/other approaches I don’t see yet?

**Question 2**  
Anything against my assuption that I can use a cron job to refresh old refresh\_tokens once a month? (point 1 and 3a)

**Question 3**  
Regarding webhooks: is there a way to tell the patreon servers (programmatically!) to send accumulated events if my server was down and is now back online?  
Without such an automatic trigger it is always possible that my system is online with old data and I need to implement path 1 or 3 anyway to get the state on demand if needed.

**Question 4**  
Can I use the clientid and clientsecret as authentication method? Which grant\_type would I set and how would I deliver the parameters? (path 3b)

Thanks a lot

---

<div class="post-metadata">

**Author:** ![andymel](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@andymel](https://www.patreondevelopers.com/u/andymel)\
**Post date:** [July 1, 2024, 7:50am UTC](https://www.patreondevelopers.com/t/connect-with-patreon-general-approach/8953/2 "2024-07-01T07:50:03Z")

</div>

Of course I am also happy to get links to pages that help me answer those questions!
