Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Messaging

A Void Merge service provides the ability to send messages to connected clients and can be set up so clients can message each other.

Create a new messaging channel for a client.

msgNew API Docs

const { msgId } = await VM.msgNew();

MsgListener API Docs

// In the client code:

import * as VM from "@voidmerge/voidmerge-client"

const listener = await VM.MsgListener.connect({
    msgId,
    ...
});

List open messaging channels.

msgList API Docs

const { msgIdList } = await VM.msgList();

Send a message over an open channel.

msgSend API Docs

await VM.msgSend({
    msg: new TextEncoder().encode("hello"),
    msgId,
});