npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@veridot/redis

v3.0.0

Published

Redis-backed implementations of Veridot stores — refresh tokens and revocations using ioredis.

Readme

@veridot/redis

Redis-backed durable stores for Veridot.

npm License: MIT Node.js

This package provides production-grade implementations of Veridot's RefreshTokenStore and RevocationStore, suitable for multi-replica deployments where every instance must share the same state.

Installation

pnpm add @veridot/core @veridot/redis ioredis

ioredis is a peer dependency. You can use any client that implements the small RedisLike interface — node-redis works as well with a thin adapter.

Usage

With the Veridot facade (recommended)

import { Veridot } from '@veridot/core';
import { RedisRefreshTokenStore, RedisRevocationStore } from '@veridot/redis';
import { Redis } from 'ioredis';

const redis = new Redis(process.env.REDIS_URL!);

const veridot = await Veridot.create({
  metadataBroker: broker,                       // your KafkaMetadataBroker / DatabaseMetadataBroker
  salt:           process.env.VDOT_SALT!,
  hashPepper:     process.env.VDOT_PEPPER!,
  expectedIssuer: 'https://auth.example.com',
  expectedAudience: 'my-api',
  refreshTokenStore: new RedisRefreshTokenStore(redis, { keyPrefix: 'vdot:rt:'  }),
  revocationStore:   new RedisRevocationStore  (redis, { keyPrefix: 'vdot:rev:' }),
});

Standalone usage

import { RedisRevocationStore } from '@veridot/redis';
import { Redis } from 'ioredis';

const store = new RedisRevocationStore(new Redis());
await store.revoke({
  target:    'jti:abc',
  expiresAt: Math.floor(Date.now() / 1000) + 3600,
  reason:    'logout',
});

const revoked = await store.isRevoked('jti:abc'); // true

Options

RedisRefreshTokenStore(redis, options?)

| Option | Type | Default | Description | | ------------ | --------- | ------------ | ------------------------------------------- | | keyPrefix | string | 'vdot:rt:' | Prefix used for all refresh-token keys. |

Records are written with a TTL matching the refresh-token expiration, so Redis reclaims memory automatically.

RedisRevocationStore(redis, options?)

| Option | Type | Default | Description | | ----------- | --------- | ------------- | ------------------------------------------ | | keyPrefix | string | 'vdot:rev:' | Prefix used for all revocation entries. |

isRevoked() is an O(1) EXISTS lookup. Entries carry a TTL so expired revocations don't accumulate.

Key design

  • Every key is namespaced with the configurable prefix — easy to share a single Redis cluster across multiple Veridot deployments.
  • TTLs are respected: stores call EXPIREAT for natural expiration in Redis.
  • Implementations are minimal and depend only on a small RedisLike interface (get, set, del, exists, expireat), making it easy to swap clients or mock the layer in tests.

Production tips

  • Use Redis 6+ (lower versions lack EXPIREAT semantics for some commands).
  • Enable AOF or RDB persistence so revocations survive restarts.
  • Run a Sentinel / Cluster setup with at least one replica.
  • Consider per-namespace ACLs if multiple services share the cluster.

Related packages

License

MIT — see LICENSE.