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

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