Would it be possible to update ENV var using Vercel Cron Jobs?
Unanswered
DennisK posted this in #help-forum
DennisKOP
Hi! We need to update the client API key every 24 hours, but since our website is just a simple static website created with Astro, I was wondering if we could use Vercel Cron Jobs to refresh the token and set this updated token in the ENV var?
7 Replies
no, env vars are decided at built time, however you can use [Vercel KV](https://vercel.com/docs/storage/vercel-kv) (key:value) or [Vercel Edge Config](https://vercel.com/docs/storage/edge-config)
ah yeah good idea, grammar is very important
DennisKOP
@riský Thanks. However, I could trigger a rebuild after changing the env var, and then it would work, right? Thanks for letting me know about Vercel KV and Edge, look into that as well.
without looking too much into it, i think you can use the vercel api to change env var and trigger rebuild, but idk if its the best option
Pretty sure you can
Vercel cli or vercel api to update followed by a rebuild