All documentation
Channels

channel().create Function in JavaScript

Create a realtime channel from JavaScript backend code.

JavaScript

Overview

channel().create(...) creates a new PulseGrid channel in the configured project.

Setup

Provide: - name - optional channelType - optional description - optional persistEvents - optional retentionDays

Code example

channel().create Function in JavaScript
const result = await pulsegrid.channel("support-room").create({
  name: "support-room",
  channelType: "public",
  description: "Public support room",
  persistEvents: true,
  retentionDays: 30,
});

console.log(result);

Notes

This is a trusted backend operation and should not be done from public frontend code.