New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@formfeed/sdk

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formfeed/sdk

Formfeed API client: renders, templates, webhooks. No dependencies, Web APIs only.

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
216
-78.25%
Maintainers
1
Weekly downloads
 
Created
Source

@formfeed/sdk

The TypeScript client for the Formfeed API: generate PDFs and images from templates. It has no dependencies and uses only Web APIs (fetch, Web Crypto), so it runs in Node 22+, Deno, Bun, Cloudflare Workers and browsers.

  • Retries 429 and 503 with the server's Retry-After.
  • Sends an Idempotency-Key with every render, so a retried request never renders twice.
  • Turns API problems into FormfeedError with code, status and request_id.
  • Verifies webhook signatures.
npm install @formfeed/sdk

Render a template

import { Formfeed } from '@formfeed/sdk';

const client = new Formfeed({ apiKey: process.env.FORMFEED_API_KEY!, region: 'eu' });

const render = await client.renders.create({
  template: 'invoice-de',
  data: { invoice: { number: '2026-0042', lines: [{ description: 'Consulting', qty: 8, price: 120 }] } },
});
console.log(render.download_url, render.page_count);

const pdf = await client.renders.download(render); // the bytes

Async renders and batches

const queued = await client.renders.create({ template: 'invoice-de', data, mode: 'async' });
const done = await client.renders.waitFor(queued.id);

const job = await client.renders.batch({
  template: 'invoice-de',
  items: orders.map((order) => ({ data: { invoice: order } })),
  zip: true,
});
const finished = await client.jobs.waitFor(job.id);

Webhooks

import { parseWebhookEvent } from '@formfeed/sdk';

// pass the raw request body, not re-serialised JSON; throws when the signature does not match
const event = await parseWebhookEvent(secret, request.headers.get('webhook-signature'), rawBody);
if (event.type === 'render.completed') console.log(event.data); // the render object

Documentation

Licence

MIT

Keywords

formfeed

FAQs

Package last updated on 13 Sep 2026

Related posts