Puppeeter with cloudflare workers
Hello! I recently saw this github repo : https://github.com/cloudflare/puppeteer
I have a SvelteKit project hosted on Cloudflare Pages and I would like to add an invoice system. I'm not very talented with PDFs, so I want to create PDF from HTML code. The only way I found was to use Puppeteer to render an html page and save it as PDF.
I did all my pdf tests in a separate project, and now that I feel more comfortable with puppeteer, I want to include it to my SvelteKit project.
I still have issues in understanding the difference between Workers and Pages, but from what I read Pages is meant for static websites, therefore there's no nodejs environment for puppeteer to run on. So my question is: Does cloudflare/puppeteer is meant to be use in workers ? If yes, can I include it in my sveltekit app and host the project in workers rather than pages ?
Have a nice day!
GitHub
GitHub - cloudflare/puppeteer: Puppeteer Core fork that works with ...
Puppeteer Core fork that works with Cloudflare Browser Workers - cloudflare/puppeteer
3 Replies
its used as part of https://developers.cloudflare.com/browser-rendering/
Cloudflare Docs
Overview | Browser Rendering docs
The Workers Browser Rendering API allows developers to programmatically control and interact with a headless browser instance and create automation flows for their applications and products. Once you configure the service, Workers Browser Rendering gives you access to a WebSocket endpoint that speaks the DevTools Protocol ↗. DevTools is what all...
Hello, I don't really understand... Are you telling me to use cloudflare browser rendering instead of puppeteer ?
The cloudflare browser rendering API is the infra (AKA Binding) that runs the puppeteer instance for you. And the
@cloudflare/puppeteer
package is what you install in your app to use the binding.