Destinations
A destination is a place a project’s events are delivered to. The four kinds are the library’s own flushers, built from what you type into the console:
| Kind | Built from | What it sends |
|---|---|---|
| Slack | A bot token and channel ids | One Block Kit message per channel and project |
| Discord | A bot token and channel ids | One message per channel and project |
| The addresses to notify | One HTML email per project, over our SMTP relay | |
| Twilio | Your own account SID, auth token and numbers | One SMS or WhatsApp message per project |
The email destination takes addresses and nothing else. The SMTP credentials are ours, so you never paste a mail password into someone else’s console. Twilio is the opposite: the messages are billed to your account, so the account is yours to give.
Each destination carries a time zone, defaulting to the project’s.
Why move them out of your code
Section titled “Why move them out of your code”The library delivers from inside your process, which is the right place when there is one service. It stops being the right place at the third one: three deployments hold the same Slack token, rotating it is three deploys, and an event is only as durable as the process that captured it.
With a destination in the console, the token lives in one place, a change takes effect without a deploy, and the fan-out runs after the events are stored, so a Slack outage costs you a notification and not the record.
Secrets
Section titled “Secrets”A destination’s credentials are encrypted at rest with AES-256-GCM before they are stored and are never returned by the API. The console shows what is public, the channel ids and the addresses, and a flag saying a secret is set. Editing one means replacing it, not reading it back.
Testing one
Section titled “Testing one”Every destination has a Send test button, which runs the same Test the library’s producer.Test(ctx) runs: Slack checks its token through auth.test, Discord reads every configured channel, Twilio lists an account, email opens an SMTP session. The failure comes back in the console rather than in a log you have to go find.
When one fails
Section titled “When one fails”A failed delivery is recorded against that destination with its error and the time. The other destinations of the project are unaffected, because the fan-out runs every one of them to completion and joins the errors; that is the library’s own patrol.FlushAll doing the work.
A destination that keeps failing is paused and shown as paused, rather than being retried forever into a channel that was deleted three weeks ago. Fix it and turn it back on.
Next: rules.