Skip to content

@xtandard/entitlements/storage/redis

Redis state storage: createRedisStorage() (JSON strings) and createRedisJSONStorage() (RedisJSON documents) over node-redis, with a Lua compare-and-swap and keyspace-notification watch.

import { … } from "@xtandard/entitlements/storage/redis";
Name Summary
createRedisJSONStorage Create a Redis storage that stores values as native RedisJSON documents. Needs Redis 8+ or Redis Stack. Never point it at keys written by createRedisStorage.
createRedisStorage Create a Redis storage that stores values as JSON strings. Works on any Redis. Connection is lazy (first operation).
Name Summary
RedisEntitlementsStorage A watchable, compare-and-swap capable storage backed by Redis, plus close().
RedisStorageOptions Options for createRedisStorage and createRedisJSONStorage.