Provides a KV adapter that stores Payload's key-value data in Upstash Redis. It is set as the kv option in the Payload config with an Upstash URL and token, and then used through payload.kv for get and set operations. It supports a custom key prefix and optional TTL rules by key prefix for automatic expiration. Works with Payload v3 and v4.
Upstash KV adapter for Payload
Installation
npm i @rubixstudios/payload-upstash7
Stars
0
Forks
0
Open Issues
Yesterday
Last Updated
0
Weekly Downloads
v1.3.0
npm Version
11.5 KB
Unpacked Size
1
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Trends appear after 7 days of data. Daily snapshots have not started yet.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1133243750-root)<a href="https://payloaddirectory.dev/plugins/1133243750-root"><img src="https://payloaddirectory.dev/badge/1133243750-root.svg" alt="Payload Directory"></a>README
This package provides a way to use Upstash as a KV adapter with Payload.
This plugin supports both Payload CMS v3 and v4 through a single release line.
| Payload CMS | Release branch | npm dist-tag |
|---|---|---|
| v4 | main | latest |
| v3 | main | latest |
Both versions are supported by the same package release. No separate branches or version-specific installations are required.
pnpm add @rubixstudios/payload-upstash
import { upstashKVAdapter } from '@rubixstudios/payload-upstash'
export default buildConfig({
collections: [Media],
kv: upstashKVAdapter({
// Upstash connection URL. Defaults to process.env.UPSTASH_URL
url: process.env.UPSTASH_URL!,
token: process.env.UPSTASH_TOKEN!,
// Optional prefix for Upstash Redis keys to isolate the store. Defaults to 'payload-kv:'
keyPrefix: 'kv-storage:',
// Optional TTL configuration for automatic expiration by key prefix
ttl: [
{ prefix: 'session:', ttl: 3600 },
{ prefix: 'cache:', ttl: 300 },
{ prefix: 'temp:', ttl: 60 },
],
}),
})
Then you can access the KV storage using payload.kv:
await payload.kv.set('key', { value: 1 })
const data = await payload.kv.get('key')
payload.logger.info(data)
This project is licensed under the MIT License - see the LICENSE file for details.
For support or inquiries:
Rubix Studios
https://rubixstudios.com.au
Topics
payload revalidate
Field-driven Next.js cache revalidation and tagged cached finders for Payload collections and globals
67151/wk18v3
payloadcms redis cache
Redis client helper for caching Payload collection data in Next.js apps
410/wk2v?
payloadcms redis plugin
Transparent Redis caching layer for Payload database read queries with automatic invalidation on writes
400/wk15v3
cached local api
Cache Payload Local API operations with Next.js unstable_cache and automatic tag revalidation
380/wk334v3
seed
Seed an Atomic Payload database from a dashboard button backed by a POST /api/seed endpoint
570/wk37v3
payload seed
Type-safe database seeding for Payload with typed cross-document references and inline media uploads
560/wk18v3