ForgeKit

ForgeKit + Sveltekit

Last verified: Feb 1, 2026

Integrate ForgeKit screenshot, PDF, and QR APIs with sveltekit.

Architecture

Connect ForgeKit utility APIs to Sveltekit for screenshot capture, PDF generation, and QR code creation. Use async jobs for long-running operations and webhooks for completion callbacks.

[Your Sveltekit App] → ForgeKit API → [Screenshot/PDF/QR Output]
                      ↓
              Async Job Queue → Webhook callback

Quick start

// Install and configure
const FORGEKIT_KEY = process.env.FORGEKIT_API_KEY;

async function captureScreenshot(url: string) {
  const res = await fetch("https://useforgekit.dev/api/v1/screenshot", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${FORGEKIT_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ url, width: 1280 }),
  });
  return res.json();
}

Common patterns

  1. On-demand capture: User action triggers ForgeKit API call
  2. Scheduled refresh: Cron job re-captures pages weekly
  3. Webhook pipeline: Async job completes → webhook updates your database

Deployment notes

  • Store FORGEKIT_API_KEY in environment variables
  • Use async jobs for pages with heavy JavaScript
  • Cache screenshot URLs in your database or CDN
  • Rate limit user-triggered captures to control costs

Community tips

  • Block third-party ad scripts for cleaner captures on news sites.
  • Use fullPage: true sparingly; it increases credits and load time.
  • Set waitForSelector when targeting SPAs with lazy-loaded content.
  • Cache screenshots for 7 days when content doesn't change frequently.

API documentation · Get API key