跳转到内容

Server 酱

协议
server-chan:
运行时
Node.js浏览器
server-chan://<uid>:<send-key>@v3[?tags=<tag>&short=<summary>]

重复 tags 可以发送多个标签,Statocysts 会使用 | 连接:

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>]

ftqq 用户名是约定写法,但不会进入请求。noip1true 时转换为 1,其他值转换为 0

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

通知标题作为 title,可选正文作为 desp

直接调用 serverChan.send() 可以传入 fetchOptions

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