Registry / storage / botbuilder-redis-storage

botbuilder-redis-storage

JSON →
library1.1.0jsnpmunverified

Redis storage adapter for Microsoft BotBuilder that implements the IBotStorage interface. Current stable version is 1.1.0. Release cadence is low, with no recent updates since 2020. Key differentiators: provides persistent state storage for bot state (dialog state, user data, conversation data) using Redis, supports custom TTL for conversations, and is built for the BotBuilder v3 SDK. Alternatives include Azure Blob Storage, CosmosDB, or SQL-based storage.

npm install botbuilder-redis-storage
INSTALL
IMPORT
SIG · BOTBUILDER-REDIS-S
B
botbuilder-redis-storage
storagejavascriptv1.1.0
harness data pending
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.

RedisStorage
import RedisStorage from 'botbuilder-redis-storage'
const RedisStorage = require('botbuilder-redis-storage')
Package uses CommonJS default export. In TypeScript or ESM, use the default import.
RedisStorage
const RedisStorage = require('botbuilder-redis-storage')
const { RedisStorage } = require('botbuilder-redis-storage')
Named import is incorrect because the package exports a single constructor as default.
new RedisStorage(client)
const storage = new RedisStorage(redisClient)
new RedisStorage()
Constructor requires a redis client instance. Passing no argument will throw an error.

Set up botbuilder-redis-storage with a Redis client and BotBuilder v3 bot.

const redis = require('redis'); const RedisStorage = require('botbuilder-redis-storage'); const builder = require('botbuilder'); const redisClient = redis.createClient(process.env.REDIS_URL ?? 'redis://localhost:6379', { prefix: 'bot-storage:' }); const storage = new RedisStorage(redisClient); const connector = new builder.ChatConnector(); const bot = new builder.UniversalBot(connector); bot.set('storage', storage); storage.setConversationTTLInSeconds(30 * 60); // optional TTL // Export bot or use in server
Debug
Known issues
deprecatedBotBuilder v3 is deprecated. v4 uses a different storage interface.
fix
Migrate to BotBuilder v4 and use its built-in storage middleware or use botbuilder-storage-redis for v4.
affects: <=1.1.0
gotchasetConversationTTLInSeconds does not refresh TTL on subsequent interactions.
fix
Use with caution. Consider implementing your own TTL refresh logic or using Redis' EXPIRE command manually.
affects: >=0.1.0
gotchaRequires a properly configured redis client instance; no default fallback.
fix
Always pass a valid redis client to the constructor.
affects: >=0.1.0
gotchaNot compatible with BotBuilder v4's Storage interface.
fix
Use botbuilder-storage-redis or implement custom storage adapter for v4.
affects: <=1.1.0
Errors
Common errors & fixes
TypeError: RedisStorage is not a constructor
Using named import or destructuring the default export incorrectly.
fix
Use default import: const RedisStorage = require('botbuilder-redis-storage');
Error: The redis client is missing. Please provide a valid redis client.
Calling constructor without a redis client argument.
fix
Pass a redis client instance: const storage = new RedisStorage(redisClient);
TypeError: redis.createClient is not a function
Using wrong version of redis package (e.g., redis@4 which changed API).
fix
Use redis@2 or redis@3: npm install redis@3
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
redisrequiredRequired peer dependency: the package expects a redis client instance to be passed in.
botbuilderrequiredUsed for the IBotStorage interface and bot setup.
Agent activity
33 hits · last 30 days
node
32
Resources
botbuilder-redis-storage — npm install botbuilder-redis-storage · libregistry