Registry / testing / redisinsight-plugin-sdk

redisinsight-plugin-sdk

JSON →
library1.1.0jsnpmunverified

The official SDK for building plugins for RedisInsight v2 application. Version 1.1.0 provides a high-level API for communication between plugins and the RedisInsight host, including executing read-only Redis commands, managing state, and formatting Redis replies. Designed exclusively for the RedisInsight plugin ecosystem; not a general-purpose Redis client library. Currently stable with no active development observed since 2021.

npm install redisinsight-plugin-sdk
INSTALL
IMPORT
SIG · REDISINSIGHT-PLUGI
R
redisinsight-plugin-sdk
testingjavascriptv1.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.

setHeaderText
import { setHeaderText } from 'redisinsight-plugin-sdk'
const { setHeaderText } = require('redisinsight-plugin-sdk')
Package ships ESM; CommonJS require may fail in some bundlers. Prefer named imports.
executeRedisCommand
import { executeRedisCommand } from 'redisinsight-plugin-sdk'
const executeRedisCommand = require('redisinsight-plugin-sdk').executeRedisCommand
Always use named import. Default export not available.
formatRedisReply
import { formatRedisReply } from 'redisinsight-plugin-sdk'
import formatRedisReply from 'redisinsight-plugin-sdk'
formatRedisReply is a named export, not default.

Demonstrates all five SDK methods: execute a Redis command, set header text, save and retrieve state, and format a reply.

import { executeRedisCommand, setHeaderText, setState, getState, formatRedisReply } from 'redisinsight-plugin-sdk'; async function run() { const result = await executeRedisCommand('GET foo'); const [{ response, status }] = result; if (status === 'success') { setHeaderText('Key retrieved'); await setState({ key: 'foo', value: response }); const savedState = await getState(); console.log('Saved state:', savedState); const formatted = await formatRedisReply(response, 'GET foo'); console.log('Formatted reply:', formatted); } } run().catch(console.error);
Debug
Known issues
gotchaOnly read-only Redis commands are supported. Write commands will fail silently or throw.
fix
Do not attempt to execute write commands like SET, DEL, etc.
affects: >=1.0.0
gotchagetState() throws an error if no state has been saved via setState(). Not a promise rejection — you must catch the synchronous throw.
fix
Wrap getState() in try/catch or check with hasState() (if available).
affects: >=1.0.0
deprecatedPackage has not been updated since 2021 (version 1.1.0). No newer versions for RedisInsight v3+.
fix
Check RedisInsight plugin API documentation for v3 compatibility; may require migration.
affects: =1.1.0
Errors
Common errors & fixes
TypeError: redisinsight_plugin_sdk_1.executeRedisCommand is not a function
Incorrect default import or CommonJS require syntax.
fix
Use named import: import { executeRedisCommand } from 'redisinsight-plugin-sdk'
Error: No state saved
Called getState() before setState() was ever invoked.
fix
Call setState() first with any value, or check state existence before calling getState().
Module not found: Can't resolve 'redisinsight-plugin-sdk'
Package not installed or used outside of RedisInsight plugin environment.
fix
Run npm install redisinsight-plugin-sdk in your plugin project. This package only works inside the RedisInsight sandbox.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
redisinsight-plugin-sdk — npm install redisinsight-plugin-sdk · libregistry