Getting started
Install the library
Section titled “Install the library”pnpm add statocystsYou can also install it with npm, Yarn, or Bun.
Send your first notification
Section titled “Send your first notification”Import send and pass it a notification target plus a title and optional body:
import { send } from 'statocysts'
await send('slack://webhook/xxx/yyy/zzz', { title: 'Deployment complete', body: 'Version 0.14.0 is now live.',})Every target is represented by a protocol URL. The protocol selects the notification provider, while the rest of the URL identifies the recipient.
Reuse multiple targets
Section titled “Reuse multiple targets”Create a notifier when you need to send repeatedly to the same targets:
import { createNotifier } from 'statocysts'
const notifier = createNotifier([ 'slack://webhook/xxx/yyy/zzz', 'jsons://example.com/notifications',])
await notifier.send({ title: 'Service recovered' })All targets are attempted in parallel. If any delivery fails, Statocysts rejects with a NotificationDeliveryError after every target has completed.
Install the CLI
Section titled “Install the CLI”pnpm add --global @statocysts/cliSend a notification directly from your terminal:
stato -u "slack://webhook/xxx/yyy/zzz" -t "Deployment complete"Verify a notification URL without sending anything:
stato verify -u "slack://webhook/xxx/yyy/zzz"