# Share desktop and mobile deployment previews in Slack

Render the deployed page at two viewport sizes and attach both PNGs to one Slack message.

[Use template](https://dashboard.fasthook.io/workflow/new?templateKey=webhook-deployment-screenshots-to-slack&templateName=Share+desktop+and+mobile+deployment+previews+in+Slack)

**Required accounts**

- Cloudflare Browser Run
- Slack
- Http

## Share desktop and mobile deployment previews in Slack

### 1. Trigger · Deployment finished

**Webhook**. Receive a JSON submission from your existing form backend at this Workflow's private webhook URL.

### 2. Transformation · Prepare the deployment previews

**FastHook**. Run JavaScript to prepare data for the next workflow step.

### 3. Action · Capture the desktop viewport

**Cloudflare Browser Run**. Capture a page or selected element at the viewport size you choose.

### 4. Action · Prepare the desktop Slack upload

**Slack**. Call another Slack Web API method with the connected app token.

### 5. Action · Upload the desktop PNG to Slack

**Http**. Send an HTTP request and use the response in subsequent steps.

### 6. Action · Capture the mobile viewport

**Cloudflare Browser Run**. Capture a page or selected element at the viewport size you choose.

### 7. Action · Prepare the mobile Slack upload

**Slack**. Call another Slack Web API method with the connected app token.

### 8. Action · Upload the mobile PNG to Slack

**Http**. Send an HTTP request and use the response in subsequent steps.

### 9. Transformation · Group both screenshots in one message

**FastHook**. Run JavaScript to prepare data for the next workflow step.

### 10. Action · Share both previews in the release channel

**Slack**. Call another Slack Web API method with the connected app token.

## Set up your workflow

1. **Send the deployment URL and release name** After your deployment finishes, POST a JSON object with url and release to the private webhook. The URL must be reachable from a Cloudflare browser.
2. **Choose the release channel** Connect your Cloudflare Browser Run account and your Slack bot. Invite the bot to the destination channel, grant it files:write and enter the channel ID in Prepare the deployment previews.
3. **Inspect both previews** Send a test release. Open the Slack message and check the desktop PNG at 1440 × 900 and the mobile PNG at 390 × 844. Both captures use one image pixel per viewport pixel.

## Related integrations

- [Webhook trigger](https://www.fasthook.io/docs/triggers/webhook)
- [Cloudflare Browser Run integrations](https://www.fasthook.io/apps/cloudflare-browser-run/integrations)
- [Slack integrations](https://www.fasthook.io/apps/slack/integrations)

## Related workflow templates

- [Revoke a retired origin certificate and notify Slack](https://www.fasthook.io/templates/origin-ca-retirement-receipts-to-slack.md): Match an approved retirement to a configured certificate, revoke it and post the Cloudflare receipt to the operations channel.
- [Archive newly issued origin certificates in R2](https://www.fasthook.io/templates/origin-ca-issued-certificates-to-r2.md): Sign a CSR for a configured origin hostname and save the signed PEM in R2 under its serial number.
- [Archive published WordPress articles in R2](https://www.fasthook.io/templates/wordpress-published-snapshots-to-r2.md): Capture the published WordPress permalink and save its rendered Markdown and desktop screenshot together in an R2 bucket.
- [Refresh a published URL and confirm it in Slack](https://www.fasthook.io/templates/webhook-cache-refresh-to-slack.md): Use a publisher webhook to evict one page and send the Cloudflare receipt to the editorial channel.
- [Send Figma file details to Slack from a webhook](https://www.fasthook.io/templates/webhook-figma-file-metadata-to-slack.md): Receive a webhook with a Figma file key, read the file's metadata from Figma, and send its name and key to a Slack channel.
