Advanced
Notifications
Post a run summary to Slack, Microsoft Teams, Discord, or email after each test run. Notifications fire after the PDF is written and do not affect your test run.
Overview
Configure one or more channels under the notify key. Each channel has its own enabled flag and on trigger, so you can send Slack on every run and email only on failure from the same config.
reporter: [['@reportforge/playwright-pdf', { notify: { slack: { url: process.env.SLACK_WEBHOOK_URL, enabled: true, on: 'failure' }, teams: { url: process.env.TEAMS_WEBHOOK_URL, enabled: true, on: 'always' }, discord: { url: process.env.DISCORD_WEBHOOK_URL, enabled: true, on: 'failure' }, email: { to: ['team@company.com'], enabled: true, on: 'failure' }, },}]]Store webhook URLs and API keys as CI secrets — never commit them to source control.
Slack
Create an Incoming Webhook at api.slack.com/apps and copy the URL. The reporter sends a Block Kit message with status, pass rate, test counts, and duration.
notify: { slack: { url: process.env.SLACK_WEBHOOK_URL, enabled: true, on: 'failure', },}Microsoft Teams
Create a workflow webhook in Teams (Workflows app → Post to a channel when a webhook request is received). The reporter sends an Adaptive Card payload.
notify: { teams: { url: process.env.TEAMS_WEBHOOK_URL, enabled: true, on: 'always', },}Legacy Office 365 Connector webhooks work but are being deprecated by Microsoft. Use Workflows webhooks for new integrations.
Discord
Create a webhook in Discord (Server Settings → Integrations → Webhooks) and paste the URL directly — no /slack suffix needed. The reporter sends a native Discord embed with a color-coded status bar.
notify: { discord: { url: process.env.DISCORD_WEBHOOK_URL, enabled: true, on: 'failure', },}Send an HTML email summary via Resend. Optionally attach the generated PDF.
notify: { email: { to: ['team@company.com', 'qa@company.com'], enabled: true, on: 'failure', attachPdf: false, // set true to attach the PDF (default: false) },}Required environment variable
| Variable | Purpose |
|---|---|
| RESEND_API_KEY | Resend API key — required. Get one at resend.com. |
| RESEND_FROM | Sender address (optional). Defaults to noreply@reportforge.org. |
If RESEND_API_KEY is absent, the reporter logs a warning and skips the email — your test run and PDF are unaffected.
Trigger options
Every channel (webhook and email) shares the same on trigger.
| Key | Type / Default | Description |
|---|---|---|
| url | string · required | Webhook URL. Applies to slack, teams, discord. |
| to | string[] · required | Recipient addresses. Applies to email only. |
| enabled | boolean · false | Must be true to send. Lets you store config without activating it. |
| on | enum · 'always' | 'always' · 'failure' · 'success'. Failure = at least one test failed, timed out, or interrupted. |
| attachPdf | boolean · false | Attach the generated PDF. Applies to email only. |