Registry / storage / sqrl-redis-functions

sqrl-redis-functions

JSON →
library0.6.10jsnpmunverified

Provides Redis-backed counter and state functions for SQRL (Safe, Stateful Rules Language for Event Streams). Current version 0.6.10, stable but not actively developed. Allows SQRL rules to store and retrieve state in Redis, enabling persistent, distributed state management across event processing pipelines. Differentiator: purpose-built for SQRL's rule engine, tightly integrated with other SQRL packages.

npm install sqrl-redis-functions
INSTALL
IMPORT
SIG · SQRL-REDIS-FUNCTIO
S
sqrl-redis-functions
storagejavascriptv0.6.10
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 redisFunctions from 'sqrl-redis-functions'
const redisFunctions = require('sqrl-redis-functions')
ESM-only package.
RedisFunctions
import { RedisFunctions } from 'sqrl-redis-functions'
Named export for TypeScript type usage.
RedisClient
import { RedisClient } from 'sqrl-redis-functions'
Type export for Redis client configuration.

Shows how to configure SQRL client with Redis functions and process an event through a rule.

import SQRL from 'sqrl'; import redisFunctions from 'sqrl-redis-functions'; const client = SQRL.createClient({ functions: [redisFunctions], config: { redis: { host: process.env.REDIS_HOST ?? 'localhost', port: parseInt(process.env.REDIS_PORT ?? '6379'), }, }, }); const rule = client.loadRule('my_rule.sqrl'); rule.on('data', (data) => console.log('Event:', data)); rule.on('error', (err) => console.error('Error:', err)); rule.on('end', () => console.log('Done')); rule.process({ event: 'page_view', userId: 1 }); rule.end();
Debug
Known issues
gotchaRedis client must be explicitly configured via config object; no automatic connection detection.
fix
Always pass a redis config object with host and port.
affects: >=0.0.0
gotchaRequires redis server running; no embedded Redis support.
fix
Ensure Redis is accessible before using sqrl-redis-functions.
affects: >=0.0.0
deprecatedSome counter functions may be deprecated in favor of newer patterns. Check documentation.
fix
Refer to https://sqrl-lang.github.io/sqrl/packages/sqrl-redis-functions.html for current API.
affects: >=0.5.0
Errors
Common errors & fixes
Error: Redis connection refused
Redis server not running or wrong host/port.
fix
Verify Redis is running and REDIS_HOST/REDIS_PORT environment variables are correct.
TypeError: redisFunctions is not a function
Importing default incorrectly with CommonJS require.
fix
Use ESM import: import redisFunctions from 'sqrl-redis-functions';
Upgrade
Version history
0.6.10latest on npm
Audit
Dependencies
sqrlrequiredCore SQRL engine for rule execution
Agent activity
28 hits · last 30 days
node
28
Resources
sqrl-redis-functions — npm install sqrl-redis-functions · libregistry