Documentation for agents: an index at /llms.txt, every docs page in one file at /llms-full.txt, and Markdown for any docs page by adding .md to its URL.

Effect KitRedis

Node.js

Connect to Redis from Node.js over TCP, TLS or a Unix socket with RedisNode.

RedisNode builds layers on node:net and node:tls. It needs Node.js 24.22.0 or later (engines.node is >=24.22.0) and supports every feature of the package.

Example (Creating the Node.js Layer)

import {  } from "effect";
import {  } from "@effect-kit/redis";
import {  } from "@effect-kit/redis/node";

const  = .({ : "redis://localhost:6379" });

const  = .(function* () {
  const  = yield* ;
  return yield* .();
});

export const  = .(.());

Creating the layer

RedisNode has six constructors. The Config variants take an Effect Config of the same input.

ConstructorBuilds a layer for
RedisNode.layer, RedisNode.layerConfigOne standalone server
RedisNode.layerCluster, RedisNode.layerClusterConfigA cluster
RedisNode.layerSentinel, RedisNode.layerSentinelConfigA Sentinel deployment

The layer export is the transport

layer exported from @effect-kit/redis/node is the transport, not a client. Build clients with RedisNode.layer(...).

Provided services

RedisNode.layer provides the full set of services for a standalone server.

Example (The Services a Node.js Layer Provides)

import type {  } from "effect";
import {  } from "@effect-kit/redis/node";

const  = .({ : "redis://localhost:6379" });

type Provided = .<typeof >;
type Provided = BatchExecutor | CommandExecutor | Crypto | Redis | RedisAdmin | RedisCredentials | RedisPubSub | RedisScripts | RedisSessions | RedisStreams

RedisTracking, RedisCache, RedisSearch and RedisMonitor are not in the set. You add them yourself.

Transport options

The transport opens one TCP, TLS or Unix socket per connection.

  • TCP: url: "redis://host:6379" or endpoint: { host, port }.
  • TLS: url: "rediss://host:6380", or endpoint with tls. A rediss: URL verifies the certificate.
  • Unix socket: endpoint: { path: "/var/run/redis/redis.sock" }. Cluster and Sentinel need TCP endpoints.

Prop

Type

Example (Connecting With a Client Certificate)

import {  } from "effect";
import {  } from "@effect-kit/redis/node";

export const  = .(
  .({
    : .({
      : .("REDIS_HOST"),
      : .("REDIS_PORT"),
      : .({
        : .("REDIS_CA"),
        : .("REDIS_CERT"),
        : .("REDIS_KEY"),
      }),
    }),
  }),
);

Tested version

The package is tested on Node.js 24.22.0, against the servers listed in Compatibility.