TypeScript SDK

The fastest way to call Snapshot Site from Node.js and TypeScript

Use the official TypeScript SDK when you want typed payloads, a single client for screenshot, analyze, and compare, and a faster path to production than hand-written fetch wrappers.

@snapshot-site/sdk
Official package
Typed client
Screenshot, analyze, compare
Node.js
Services, scripts, full-stack apps
Install:pnpm add @snapshot-site/sdk
Auth:SNAPSHOT_SITE_API_KEY=ss_live_xxx
TypeScript workflow
Good fits
Node.js services that need typed request and response payloads
Cron jobs and worker pipelines that capture or analyze pages
Full-stack apps that want one client for screenshot, compare, and analyze
Teams that want to avoid hand-writing raw HTTP wrappers

SDK overview

The TypeScript SDK wraps the Snapshot Site API in a single client. It is the lowest-friction option when your application already lives in JavaScript or TypeScript.

1

One client for all Snapshot Site endpoints

Use a single `SnapshotSiteClient` instance to run screenshot, analyze, and compare workflows.

2

Typed payloads

The SDK is designed to reduce mistakes in request shapes and keep integrations readable.

3

Good fit for backend automation

Use it in Node.js services, background jobs, scripts, and full-stack application backends.

4

Closer to production than raw fetch

You can move from API key to working integration without rebuilding auth, paths, and request plumbing yourself.

Quick start

Install, configure, call the client

1

Install `@snapshot-site/sdk` in your app

2

Set `SNAPSHOT_SITE_API_KEY` in your environment

3

Instantiate `SnapshotSiteClient`

4

Call `screenshot`, `analyze`, or `compare` with typed payloads

Code examples

Screenshot

Minimal screenshot example

Capture a page in a few lines with a single client instance.

import { SnapshotSiteClient } from "@snapshot-site/sdk";

const client = new SnapshotSiteClient({
  apiKey: process.env.SNAPSHOT_SITE_API_KEY!,
});

const result = await client.screenshot({
  url: "https://snapshot-site.com/pricing",
  format: "png",
  width: 1440,
  fullSize: true,
  hideCookie: true,
});

console.log(result.link);
Analyze

Analyze example

Run page analysis and extract summary-oriented output.

const analysis = await client.analyze({
  url: "https://snapshot-site.com",
  width: 1440,
  fullSize: true,
  enableSummary: true,
  enableQuality: true,
});

console.log(analysis.summary);
Compare

Compare example

Compare two page states and inspect diff-oriented results.

const diff = await client.compare({
  before: {
    url: "https://snapshot-site.com/pricing",
    width: 1440,
    fullSize: true,
    hideCookie: true,
  },
  after: {
    url: "https://staging.snapshot-site.com/pricing",
    width: 1440,
    fullSize: true,
    hideCookie: true,
  },
  threshold: 0.1,
});

console.log(diff.diff?.link);
console.log(diff.summary?.mismatchPercentage);