https://github.com/ascorbic/cdp-edge-inject
https://github.com/ascorbic/cdp-edge-inject
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ascorbic/cdp-edge-inject
- Owner: ascorbic
- Created: 2022-06-27T15:02:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-10T12:47:42.000Z (over 3 years ago)
- Last Synced: 2025-01-23T14:38:26.594Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://deploy-preview-1--cdp-edge-inject.netlify.app/
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CDP on the edge
This is an example of using an edge function to inject the collaborative deploy preview snippet in dynamic pages. This uses HTMLRewriter, which is a high-performance streaming HTML parser from Cloudflare.
It currently needs a build plugin because the site ID, deploy ID etc aren't available to the edge function. The plugin writes those values to a JSON file that is imported into the edge function.