Keys / Upstash
UPSTASH_REDIS_REST_TOKEN
The token your app sends with every request to an Upstash Redis database's REST API. The standard token can run any command.
- Expires
- the docs don't say
- API
- reset, with the Upstash Developer API
Get it
Create one on console.upstash.com/redis. The steps aren't recorded yet.
Set it
UPSTASH_REDIS_REST_TOKEN=...
Redis.fromEnv() in the TypeScript SDK and Redis.from_env() in the Python SDK read it. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- A database has one standard token. To replace it, reset the database's password in the console; the read-only token changes too.
- The reset restarts the database, so it's briefly unavailable. Right away, deploy the new token everywhere that reads
UPSTASH_REDIS_REST_TOKEN, and the new password and read-only token to whatever uses those. - For a token you can replace on its own, create an ACL user with
ACL SETUSERand a REST token withACL RESTTOKEN. A reset doesn't change those.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.