Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonw/puppeteer-screenshot
Vercel app for taking screenshots of web pages using Puppeteer
https://github.com/simonw/puppeteer-screenshot
puppeteer screenshots vercel
Last synced: 4 months ago
JSON representation
Vercel app for taking screenshots of web pages using Puppeteer
- Host: GitHub
- URL: https://github.com/simonw/puppeteer-screenshot
- Owner: simonw
- License: mit
- Created: 2020-09-01T18:02:36.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-24T03:44:22.000Z (over 2 years ago)
- Last Synced: 2024-10-07T11:54:58.901Z (4 months ago)
- Topics: puppeteer, screenshots, vercel
- Language: JavaScript
- Homepage: https://puppeteer-screenshot-eight.vercel.app
- Size: 5.86 KB
- Stars: 46
- Watchers: 4
- Forks: 22
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# puppeteer-screenshot
Vercel app for taking screenshots of web pages using Puppeteer
Original code by [@styfle](https://github.com/styfle) in [this pull request](https://github.com/vercel/now-examples/pull/207).
I upgraded the code to work with the latest Vercel and added a `?key=` mechanism to protect it from unauthorized access.
## Usage
Set a Vercel secret called `SECRET_KEY` with a random string in it (I generated mine by running `uuidgen | md5`), then deploy.
You can access screenshots for pages using:
https:/.../zeit.co/blog?type=png&key=...
Screenshots can take several seconds to generate so it's a good idea to cache them somewhere.
## Querystring arguments
- `?viewportWidth=` sets the browser viewport width in pixels. This defaults to 800.
- `?viewportHeight=` sets the browser viewport height in pixels. This defaults to 600.
- `?type=` set the output type to `png` or `jpeg`. Default is `png`.
- `?quality=75` set the JPEG output qualit. Ignored for PNG.
- `?fullPage=true` fetch a screenshot of the full page, not just the browser viewport.