Can run on cloud
You don't need webdriver for taking screenshots on web
Screenshot any URL from Node.js without installing Puppeteer or Chrome.
Shotsnap sends the URL to a hosted cloud browser at shotsnap.vercel.app, which loads the page and returns a PNG. You get the image as a Buffer and can write it to a file in the same call.
import { takeScreenshot } from "shotsnap";
const image = await takeScreenshot({
pageUrl: "https://example.com",
saveFile: true,
fileName: "example.png",
});The same screenshot API answers plain HTTP requests, which the screenshot guide covers along with the library.
Shotsnap fits jobs where you need a picture of a public web page and nothing more: a link preview in a chat bot, a thumbnail for a bookmark list, a visual record in a small script or a serverless function where bundling a browser binary is awkward. The package exports a single function, so there is little to learn.
If you need to click, log in, capture a single element or reach a site on localhost, run a browser yourself. The Puppeteer comparison shows both approaches side by side.
takeScreenshot builds a GET request to https://shotsnap.vercel.app/api/screenshot with the page URL and the screen size, then waits for the response. The browser runs on the hosted service, not on your machine. When the image arrives, the function turns it into a Node.js Buffer. With saveFile: true it also writes the Buffer to disk before returning it.
| Option | Default | Purpose |
|---|---|---|
pageUrl | none | The page to capture |
screenWidth | 800 | Viewport width in pixels |
screenHeight | 768 | Viewport height in pixels |
saveFile | none | Write the image to disk when set |
fileName | shotsnap.png | Where the image is written |
The Props page describes each option in detail.
require and import.Ready to try it? Start with Getting Started.