Skip to main content

Documentation Index

Fetch the complete documentation index at: https://upstash.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Arguments

channels
string | string[]
required
The channel to publish to.

Response

A subscriber instance which can subscribe to channels.
const subscription = redis.subscribe(["my-channel"]);

const messages = [];
subscription.on("message", (data) => {
  messages.push(data.message);
});