*** id: 39b75605-0eff-435a-968d-5ac18c2c46d1 title: PubSubMessage keywords: 'SignalWire, Realtime SDK, Node.js, PubSub message, event message' slug: /node/reference/pubsub/pubsub-message sidebar-title: PubSubMessage description: >- PubSubMessage object representing a message in a PubSub channel. Access message ID, content, channel, publisher ID, and metadata properties. max-toc-depth: 3 ---------------- Represents a message in a PubSub context. ## **Properties** The id of this message. The channel in which this message was sent. The content of this message. The date and time at which this message was published. Any metadata associated to this message. ## **Example** Listening for PubSub messages and accessing `PubSubMessage` properties: ```js import { SignalWire } from "@signalwire/realtime-api"; const client = await SignalWire({ project: "your-project-id", token: "your-api-token" }); await client.pubSub.listen({ channels: ["my-channel"], onMessageReceived: (message) => { console.log("Message ID:", message.id); console.log("Channel:", message.channel); console.log("Content:", message.content); console.log("Published at:", message.publishedAt); console.log("Metadata:", message.meta); } }); ```