Variable expiration¶
Each Vari may have an optional expiresAt timestamp (ISO / date string) on create and update. Use it when you store OAuth tokens or other credentials that go stale.
Set and update¶
On create or PATCH of a variable, include expiresAt.
Checking expiry¶
Fetch the variable by id (metadata). For secrets, that fetch omits the secret value but can still include
expiresAt.Compare
expiresAtto now.If expired or near expiry, refresh the token, then update value and
expiresAt.
SDK .get() / .inject() return the value (or an inject reference), not a dedicated expiry helper. Secrets still cannot be .get() from a local client; use .inject() inside a server function or API function. See Vari in Your Code.
Companion expiry variable¶
If id-only metadata get is awkward, a common pattern is a second non-secret Vari that holds the expiry next to the secret Vari. Keep context + name stable.
Related: Vari Variables, Tabi Tables (large datasets do not belong in Vari).