Registry / storage / botbuilder-storage-redis

botbuilder-storage-redis

JSON →
library1.1.2jsnpmunverified

Implements Redis-based state storage for Microsoft Bot Framework V4 (botbuilder-js), enabling scalable, persistent bot state management. Version 1.1.2 is current, with a stable API and no recent updates. Key differentiator: provides TTL-based automatic expiration for conversation state, unlike the built-in memory store. Requires Node.js 12+ and a Redis server. Supports both CommonJS and ESM usage.

storage
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Default export is not provided; must use named import. CommonJS require works with destructuring: const { RedisDbStorage } = require('botbuilder-storage-redis').

import { RedisDbStorage } from 'botbuilder-storage-redis'

There is no default export. Only named export RedisDbStorage exists.

import { RedisDbStorage } from 'botbuilder-storage-redis'

CommonJS require must destructure the named export. Direct assignment gives undefined.

const { RedisDbStorage } = require('botbuilder-storage-redis')

Creates a Redis client with optional prefix and TTL, then configures a BotFramework bot to use it for state storage.

import redis from 'redis'; import { RedisDbStorage } from 'botbuilder-storage-redis'; import * as builder from 'botbuilder'; const redisOptions = { prefix: 'bot-storage:' }; const redisClient = redis.createClient(process.env.REDIS_URL || 'redis://localhost:6379', redisOptions); const ttlInSeconds = 10; const storage = new RedisDbStorage(redisClient, ttlInSeconds); const connector = new builder.ChatConnector(); const bot = new builder.UniversalBot(connector); bot.set('storage', storage); console.log('Bot configured with Redis storage');
Debug
Known footguns
gotchaTTL does not refresh on subsequent interactions; conversations expire after initial TTL regardless of activity.
deprecatedThis package uses the older `redis` npm library (v2.x/v3.x) and may not be compatible with `redis` v4+ API changes.
gotchaThe package does not support the newer `botbuilder` dialogs and adaptive dialog patterns; only classic `UniversalBot`.
gotchaRedis client must be connected before creating `RedisDbStorage`; no built-in reconnection handling.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
18 hits · last 30 days
bytedance
4
gptbot
3
amazonbot
3
Resources