update an env variable from a global action
Is it possible to update an env variable from within a global action?
3 Replies
Hello,
You can't update an environment variable from an action. That wouldn't be a safe practice either. Whats your use case here?
We have a access token that needs to get refreshed every 8 hours, and its global across all models. (for ex in shopify app context, its global to all shops)
A workaround that comes to mind:
- Make a custom model named nonStatic or something to identify the rotating values
- Add fields that pertain to the token (expiry, value, etc)
- Have a global action that rotates the token (only change that one record)
- From the backend you can always fetch that record at its current state
There might be some better way to do this but this is a quick fix