TypeScript SDK

Pdffillr TypeScript SDK

The official TypeScript and JavaScript client library for the Pdffillr REST API. Install it, point it at your API key, and every endpoint is immediately accessible through a clean, fully-typed interface — no raw HTTP requests, no manual header management, no JSON parsing. Generated with Stainless.

TypeScript / JavaScriptServer-sideNode.js ≥ 20 LTSGenerated with StainlessBundled types
Quick look
quick-look.ts
import Pdffillr from '@pdffillr/sdk';

const client = new Pdffillr({
  apiKey: process.env['PDFFILLR_API_KEY'], // This is the default and can be omitted
});

// That's it. Every API resource is available through the client.
await client.sdk.chat.sessions.create({ title: 'My first session' });

1. What is the Pdffillr SDK?

The Pdffillr SDK is the official client library for the Pdffillr REST API, published for TypeScript and JavaScript. It is built for server-side and edge runtimes — Node.js services, serverless functions, Deno, Bun, Cloudflare Workers, and more — and gives you structured, strongly-typed access to every API resource through a predictable property chain on the client object.

Without the SDK, integrating the Pdffillr API means writing fetch calls, setting Authorization headers manually, deserialising JSON bodies, and maintaining your own error-handling wrappers. The SDK eliminates all of that. Authentication, request construction, response parsing, automatic retries, and configurable timeouts are handled internally — your code calls a method and receives a typed result.

Fully typed API surfaceEvery method, parameter, and response ships with TypeScript declarations. No @types/ package needed. Autocomplete, hover docs, and compile-time checks work out of the box.
Types bundled - zero extra installs
Secure by defaultAPI keys live in environment variables, never in source code. Every request is made over HTTPS. The SDK attaches your credentials to each call automatically - you never set a header manually.
Environment-variable-driven auth
Server-side runtimeDesigned for Node.js 20 LTS and later. Ships both ESM and CommonJS builds. Compatible with Deno, Bun, Cloudflare Workers, Vercel Edge Runtime, and similar runtimes.
Node.js ≥ 20 LTS · ESM + CJS · Multi-runtime

2. When to Use the SDK

The SDK is the right choice whenever you need to interact with the Pdffillr API from a server-side TypeScript or JavaScript environment. Below are the most common scenarios where teams reach for it.

Backend API services

Your application exposes a REST or GraphQL API and needs to trigger Pdffillr sessions on behalf of your users - for example, when a user submits a form in your front-end, your backend calls sessions.create() and returns the session details.

Serverless functions

An AWS Lambda function, a Vercel Serverless Function, or a Cloudflare Worker receives a webhook or a scheduled trigger and uses the SDK to create a session and begin processing a document.

Automated pipelines and scripts

A Node.js script or a CI job that programmatically processes a batch of documents - for example, pulling files from S3 and creating a Pdffillr session for each one - benefits from the SDK's type safety and clean error handling.

Internal tools and admin dashboards

A Next.js or Remix application with server-side routes (not browser-side) that needs to trigger or monitor Pdffillr sessions as part of an internal workflow management tool.

The SDK is server-side only
The SDK is built for Node.js and server-side runtimes. It must not be imported into browser-side bundles - your API key would be exposed in the client JavaScript. If you need to trigger Pdffillr sessions from a browser, proxy the call through your own backend server or a serverless function.

3. How It Works

The SDK is a thin, typed wrapper around the Pdffillr REST API. When you call a method, the SDK constructs the correct HTTP request, attaches your API key, sends it over HTTPS, and resolves the returned Promise with a deserialised, fully-typed response object. You never write a fetch call or parse a JSON body manually.

01
You call a typed SDK method→ Method call

Your application code calls a method like client.sdk.chat.sessions.create(). The method name, parameters, and return type are all defined by the SDK's TypeScript declarations.

02
The SDK builds and sends the request→ HTTPS request

Internally, the SDK constructs the HTTP request - method, URL, headers (including Authorization: Bearer <key>), and body - then sends it over HTTPS to the Pdffillr API.

03
The API responds and the SDK resolves→ Typed response object

The Pdffillr API processes the request and returns a JSON response. The SDK deserialises the body, applies the TypeScript type, and resolves the Promise with the typed object your code receives.


SDK documentation

Explore the SDK

Each page below covers one aspect of the SDK in depth. Start with Installation if this is your first time, or jump directly to the topic you need.

Was this page helpful?
PDFFILLR.AI logo

PDFFILLR.AI

The intelligent layer for modern fund
administration. Automating high-stakes
documentation with precision and speed.

Powered byEngineersMind