Skip to content

js-bao-wss-client


js-bao-wss-client / DirectMessageEvent

Interface: DirectMessageEvent ​

A message a server function sent to this user or this connection.

Emitted over the directMessage event channel (client.on("directMessage", ...)) when a function calls ctx.users.send or ctx.connections.send while this client is connected. payload is the function's own value, passed through unread by the platform.

It is a LIVE frame with no durable record behind it: a client that was offline when the function ran does not receive it later. functionKey is the frame's only attribution — a function running in system mode acts for nobody, so there is no user to name.

Properties ​

functionKey ​

functionKey: string


payload ​

payload: unknown


sentAt ​

sentAt: string

When the platform sent it, ISO 8601.


type ​

type: "direct.message"

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30