Overview
When you connect a GitHub repo to a Canvas app, every pull request gets its own preview deployment at a unique URL. Reviewers can test changes live before merging — no manual deploy needed.How it works
- Open a PR targeting your app’s connected branch
- GitHub sends a
pull_requestwebhook to Canvas - Canvas clones the PR’s head branch, builds it, and deploys to a preview environment
- The preview is live at
https://pr-{N}-{slug}.mxp.co - Push more commits to the PR — the preview auto-updates
- Close or merge the PR — the preview environment is cleaned up
Preview URLs
Preview deploys follow a predictable URL pattern:| PR | App slug | Preview URL |
|---|---|---|
| #42 | my-app | https://pr-42-my-app.mxp.co |
| #17 | taste | https://pr-17-taste.mxp.co |
| #103 | dashboard | https://pr-103-dashboard.mxp.co |
Setup
Preview deploys work automatically once your repo is connected. No additional configuration is needed.Open a pull request
Open a PR targeting the connected branch (e.g.,
main). Canvas automatically detects the PR and starts building.Supported webhook events
| Event | Action | Canvas behavior |
|---|---|---|
pull_request | opened | Build and deploy preview |
pull_request | synchronize | Rebuild preview with new commits |
pull_request | reopened | Rebuild preview |
pull_request | closed | Clean up preview environment |
Preview vs staging vs production
| Environment | URL pattern | Use case |
|---|---|---|
| Production | {slug}.mxp.co | Live site |
| Staging | staging-{slug}.mxp.co | Manual staging deploys |
| Preview | pr-{N}-{slug}.mxp.co | Automatic per-PR previews |
Cleanup
When a PR is closed (merged or not), Canvas automatically:- Removes the preview environment from the app’s configuration
- Deletes preview assets from S3

