notify

View as MarkdownOpen in Claude

Send a fire-and-forget JSON-RPC notification to the Relay server. No response is awaited. The call no-ops when the socket is closed.

Production code should almost always use execute() instead, which sends a request and checks the response. notify() is a low-level escape hatch for cases where no response is expected.

Parameters

method
stringRequired

The JSON-RPC method name.

params
Record<string, unknown>Required

Parameters for the notification.

Returns

void — fire-and-forget; no response is awaited.

Example

import { RelayClient } from '@signalwire/sdk';
const client = new RelayClient({
project: process.env.SIGNALWIRE_PROJECT_ID!,
token: process.env.SIGNALWIRE_API_TOKEN!,
contexts: ['default'],
});
client.notify('custom.method', { key: 'value' });