rubix-studios-pty-ltd

payload upstash

by rubix-studios-pty-ltd
Databases & data
v3
^3.90.2
MIT

Overview

Summary generated from the README

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.

Features

  • Upstash Redis backed adapter for the Payload kv config option
  • Access through payload.kv get and set methods
  • Configurable key prefix to isolate the store
  • TTL rules per key prefix for automatic expiration
  • URL defaults to an environment variable
  • Single release supporting Payload v3 and v4

Use cases

  • Store cache or session data in serverless Upstash Redis instead of the default Payload KV store
  • Expire temporary keys automatically by applying per-prefix TTLs

From the author

Upstash KV adapter for Payload

Installation

npm i @rubixstudios/payload-upstash

7

Stars

0

Forks

0

Open Issues

Yesterday

Last Updated

0

Weekly Downloads

v1.3.0

npm Version

11.5 KB

Unpacked Size

1

Dependencies

GitHub stars

Trends appear after 7 days of data. Daily snapshots have not started yet.

npm weekly downloads

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

69/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1133243750-root.svg)](https://payloaddirectory.dev/plugins/1133243750-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1133243750-root"><img src="https://payloaddirectory.dev/badge/1133243750-root.svg" alt="Payload Directory"></a>
Updated Oct 20, 2026Created Jan 13, 2026Published Oct 11, 2026

README

PayloadCMS + Upstash KV Adapter

This package provides a way to use Upstash as a KV adapter with Payload.

Compatibility

This plugin supports both Payload CMS v3 and v4 through a single release line.

Payload CMSRelease branchnpm dist-tag
v4mainlatest
v3mainlatest

Both versions are supported by the same package release. No separate branches or version-specific installations are required.

Installation

pnpm add @rubixstudios/payload-upstash

Usage

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)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support or inquiries:

Author

Rubix Studios
https://rubixstudios.com.au

Similar plugins