Upstash Redis storage adapter for Keyv v1.0.8, requiring Node >= 18. Built on @upstash/redis, it provides a drop-in replacement for @keyv/redis for serverless and edge environments. Supports TTL, namespaces, both CommonJS and ESM, and is fully typed. Unlike @keyv/redis, it uses HTTP-based Redis via Upstash, making it ideal for serverless functions. It is actively maintained with regular releases.
npm install keyv-upstashNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a Keyv instance with keyv-upstash using URL and token from environment variables, set and get a value.
Set automaticDeserialization: false when creating the Redis instance.
Always set automaticDeserialization: false (this is the default, but explicit is safer).
Use keyv.set('key', 'value', ttl) where ttl is milliseconds (e.g., 10000 for 10s).Upgrade Node.js to version 18 or higher.
Use named import: import { KeyvUpstash } from 'keyv-upstash'Provide 'url' and 'token' options or pass a pre-configured 'upstashRedis' client.
Ensure keys are strings (Keyv coerces to string, but Upstash Redis may not).