Skip to main content

Setup

npm install ioredis
import { RedisStorage } from "@radaros/core";

const storage = new RedisStorage({
  host: "localhost",
  port: 6379,
  ttl: 86400,  // 24 hour TTL (optional)
});

// Or use a URL
const storage = new RedisStorage({ url: "redis://localhost:6379" });

Configuration

OptionTypeDefaultDescription
hoststring"localhost"Redis host
portnumber6379Redis port
passwordstringRedis password
dbnumber0Redis database number
urlstringFull Redis URL
keyPrefixstring"radaros"Key prefix for namespacing
ttlnumberTTL in seconds (optional)
Keys are stored as {prefix}:{namespace}:{key} with JSON-serialized values.