Skip to content

Server Chan

Protocol
server-chan:
Runtime
Node.jsBrowser
server-chan://<uid>:<send-key>@v3[?tags=<tag>&short=<summary>]

Repeat tags to send multiple tags; Statocysts joins them with |:

server-chan://UID:SEND_KEY@v3?tags=operations&tags=production&short=Recovered
server-chan://ftqq:<send-key>@turbo[?short=<summary>&noip=<value>&channel=<channel>&openid=<openid>]

The ftqq username is conventional but not used in the request. noip becomes 1 for 1 or true, and 0 otherwise.

import { send } from 'statocysts'
await send(
'server-chan://ftqq:SEND_KEY@turbo?noip=1',
{ title: 'Deployment complete', body: 'Production is healthy.' },
)

The notification title is sent as title; the optional body is sent as desp.

Direct serverChan.send() calls accept fetchOptions:

import { serverChan } from 'statocysts'
await serverChan.send(target, notification, {
fetchOptions: { timeout: 5000 },
})