For message formatting instructions, see this dedicated page.
1. Create an incoming webhook in Discord
- Navigate to the channel where you want to add the webhook and select the 'Edit Channel' option from left navigation pane.
- Select the 'Integrations' option from the left navigation pane.
- If creating a webhook for the first time, click the "Create Webhook" button.
- If you have other webhooks, click "View Webhooks" and now click "New Webhook".
- Give the webhook any name you prefer (say PostHog).
- Select the channel where the message should be posted from the drop-down.
- Click the "Copy Webhook URL" button to copy the webhook URL into the clipboard.
It would look something like this.
For more information see the Discord webhook docs.
2. Setup webhook in PostHog
Copy the Webhook URL into the PostHog Setup page:
Click "Test & Save" and you should receive a message on Discord.
3. Add to action
For each Action that should be posted to Discord, select "Post to webhook when this action is triggered":