I need to create and persist OAuth access tokens and refresh tokens somehow, so I can use them in my serverless functions.
I was thinking of storing them as environment variables and then updating them from within the serverless function when they expire.
But so far I can’t see how to update environment variables programmatically from within a serverless function. It only seems possible to do that using the UI.
Also, I’m not entirely sure if the new programmatically set environment variable would be usable because I think they get injected at build time, not runtime.
Do you have any suggestions on how to tackle this problem?