All documentation
Messages

channel().publish Function in JavaScript

Publish a server-side event into a channel over HTTP.

JavaScript

Overview

channel().publish(...) lets backend JavaScript code publish events or messages into a PulseGrid channel over HTTP.

Setup

Provide: - text - optional identifierId - optional identifierLabel - optional event - optional meta - optional extra data

Code example

channel().publish Function in JavaScript
const result = await pulsegrid.channel("demo-channel").publish(
  "Hello from server publish",
  {
    identifierId: "server_bot",
    identifierLabel: "Server Bot",
    meta: {
      source: "js_http_publish",
    },
  }
);

console.log(result);

Notes

Great for backend workflows, notifications, bots, and scheduled events.