Skip to content
dokus home
Sign inLet’s talk ↗

Add document generation to your TypeScript application.

Separate packages for document structure, blueprints, server requests, and browser viewing. Install only what your code needs. Everything you send is typed JSON.

  • ESM
  • Node.js server client
  • Browser WASM viewer

Name every input in the render request.

The API key stays on the server. The render request names a document version, a blueprint, and the data for that run. The response is a run you can inspect later.

Server exampleTypeScript
import { createDokusClient } from "@dokus/client";
import { defineBlueprint, input, values } from "@dokus/blueprint";

const dokus = createDokusClient({
  apiKey: process.env.DOKUS_API_KEY!
});

const blueprint = defineBlueprint({
  inputSchema,
  rules: [values({ "customer.name": input("customerName") })]
});

const started = await dokus.documents.render({
  documentId,
  versionId,
  blueprint,
  data: { customerName: "Northstar Logistics" },
  generatePdf: true
}, { idempotencyKey });

const run = await dokus.runs.wait(started.runId);
THE DEVELOPER TOOLKIT

Four focused packages.
Each with one job.

Choose the part your application needs.
Explore what each package does.

DOCUMENT MODEL01 / 04

Shape the document.

@dokus/dksd

Create documents, inspect exact snapshots, and build ordered document changes.

  • Create document structure
  • Inspect exact snapshots
  • Build ordered changes
A CLEAR DIVISION OF RESPONSIBILITY

Your server stays in control.
Your browser brings it into view.

01 / TRUSTED NODE.JS

Server

@dokus/client

Keep credentials and persistence on your server.

  • Authorization & API keys
  • Transport & storage decisions
  • Render requests & retries
AUTHORIZED DOCUMENT
& FONT BYTES
API keys stay on the server.
02 / READ-ONLY VIEWER

Browser

@dokus/document-viewer

Render the document and select its content.

  • Exact document & font bytes
  • Text, fields, blocks & tables
  • No editing, saving or API keys
Each side has a clear job. Your application connects them.Editor in development ↗

Safe for agents by construction.

Every artifact is inert JSON. Nothing you send is executed.

Typed artifacts, no code

Definitions, blueprints, and transactions are validated JSON. Rules use a closed expression language; no function, source text, or template syntax is ever serialized.

Compiled against the exact version

The server resolves a blueprint against one exact document version and rejects anything that does not match before it renders.

Idempotent by default

Every write and every render carries an idempotency key, so a retrying agent gets the same result instead of a duplicate.

AVAILABLE TODAY

Build with TypeScript.

Agents use the same typed packages as your application.

PLANNED

Purpose-built for agents.

A published coding-agent skill.
A runtime surface for AI agents.

YOUR FIRST BUILD

Small start. Real output.

One document. One typed field.
See what you can build with dokus.