Skip to content

Getting started

Terminal window
pnpm add statocysts

You can also install it with npm, Yarn, or Bun.

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.

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.

Terminal window
pnpm add --global @statocysts/cli

Send a notification directly from your terminal:

Terminal window
stato -u "slack://webhook/xxx/yyy/zzz" -t "Deployment complete"

Verify a notification URL without sending anything:

Terminal window
stato verify -u "slack://webhook/xxx/yyy/zzz"