ForgeKit + Vercel AI SDK
Last verified: Feb 1, 2026
Multi-modal agents with screenshot capabilities.
Architecture
Connect ForgeKit utility APIs to Vercel AI SDK for screenshot capture, PDF generation, and QR code creation. Use async jobs for long-running operations and webhooks for completion callbacks.
[Your Vercel AI SDK App] → ForgeKit API → [Screenshot/PDF/QR Output]
↓
Async Job Queue → Webhook callbackQuick 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
- On-demand capture: User action triggers ForgeKit API call
- Scheduled refresh: Cron job re-captures pages weekly
- 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.