Registry / storage / wappler-redis-toolkit

wappler-redis-toolkit

JSON →
library1.0.0jsnpmunverified

A Wappler Server Connect extension for interacting with Redis databases directly from the Wappler visual development environment. Current stable version is 1.0.0. The toolkit provides over a dozen server actions for common Redis operations including JSON storage, counters, key management, collections (sets and lists), and custom Redis commands. It requires the ioredis library (peer dependency) and a functioning Redis connection. Differentiating from generic Redis clients, it integrates directly into Wappler's server workflow UI with no coding required.

npm install wappler-redis-toolkit
INSTALL
IMPORT
SIG · WAPPLER-REDIS-TOOL
W
wappler-redis-toolkit
storagejavascriptv1.0.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.

default
import ioredis from 'ioredis'
const ioredis = require('ioredis')
ESM import is recommended for modern projects; the extension is designed for Wappler which uses ESM.
Redis
import { Redis } from 'ioredis'
const Redis = require('ioredis').Redis
Named import for the Redis class if you need to instantiate directly.
Pipeline
import { Pipeline } from 'ioredis'
const Pipeline = require('ioredis').Pipeline
For pipeline operations, import Pipeline type/class.

Demonstrates using the Redis Toolkit to connect to Redis and insert JSON data, typical of how server actions are structured in Wappler.

// Ensure ioredis is installed and a Redis connection is configured in Wappler. // This is a server action that inserts JSON into a Redis key. import { ServerAction } from '@wappler/server-connect'; const action: ServerAction = { name: 'insertJsonToRedis', handler: async (inputs: { key: string; data: any }) => { const { key, data } = inputs; const Redis = require('ioredis'); const redis = new Redis({ host: process.env.REDIS_HOST ?? '127.0.0.1', port: parseInt(process.env.REDIS_PORT ?? '6379'), password: process.env.REDIS_PASSWORD ?? undefined }); await redis.set(key, JSON.stringify(data)); await redis.quit(); return { success: true }; } }; export default action;
Debug
Known issues
breakingThis extension requires the ioredis library to be installed in the project. If missing, actions will fail silently or throw errors.
fix
Run 'npm install ioredis' or ensure Wappler auto-installs it on deployment.
affects: >=1.0.0
gotchaThe environment variables (REDIS_HOST, REDIS_PORT, etc.) are optional but if not set, the extension uses defaults (127.0.0.1:6379). Ensure they are configured for production.
fix
Set environment variables in your deployment environment or Wappler server config.
affects: >=1.0.0
gotchaWhen using TLS, set the REDIS_TLS environment variable to '{}' (empty object) or a valid TLS object. Using 'true' will cause connection failures.
fix
Set REDIS_TLS to '{}' in your environment variables for TLS without a custom cert.
affects: >=1.0.0
deprecatedThe 'Get All Keys in Redis' action may block the event loop on large databases. Consider using SCAN instead.
fix
Use the 'Run Redis Command' action with SCAN for key retrieval on production systems.
affects: >=1.0.0
gotchaThe 'Insert JSON to Redis' action does not validate that the data is valid JSON before storing; invalid data may cause runtime errors on retrieval.
fix
Ensure data is a valid JSON object or string; use JSON.stringify() in custom scripts if necessary.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'ioredis'
The ioredis library is not installed in the project.
fix
Run 'npm install ioredis' in your project root or trigger deployment in Wappler to auto-install.
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
Redis server is not running or connection parameters are incorrect.
fix
Ensure Redis is running and accessible with the configured host/port. Check firewall and environment variables.
TypeError: redis.set is not a function in Insert JSON to Redis action
The Redis connection object is not properly instantiated; likely missing ioredis import or incorrect initialization.
fix
Verify that ioredis is installed and the Redis constructor is called correctly (e.g., new Redis()).
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
ioredisrequiredRequired to establish a Redis connection and execute commands
Agent activity
36 hits · last 30 days
node
32
Resources
wappler-redis-toolkit — npm install wappler-redis-toolkit · libregistry