Document Stack
Document Stack
Docs

SDK Overview

Official client libraries for Node.js, Python, and Go to integrate Document Stack into your application.

Available SDKs

Document Stack provides official SDKs for three languages. Each SDK wraps the REST API, handles authentication, and provides typed interfaces for all operations.

LanguagePackageMin Version
Node.js / TypeScript@document-stack/sdk-nodeNode 18+
Pythondocument-stackPython 3.9+
Gogithub.com/documentstack/sdk-goGo 1.21+

Quick Install

Node.js
npm install @document-stack/sdk-node
Python
pip install document-stack
Go
go get github.com/documentstack/sdk-go

Basic Usage

Every SDK follows the same pattern: create a client with your API key, then call methods on it.

Node.js
import { DocumentStack } from "@document-stack/sdk-node";

const client = new DocumentStack({ apiKey: process.env.DS_API_KEY! });

const pdf = await client.generate({
    templateId: "tmpl_abc123",
    data: { customerName: "Alice", amount: 99.99 },
});

console.log("PDF URL:", pdf.url);
Python
from document_stack import DocumentStack

client = DocumentStack(api_key=os.environ["DS_API_KEY"])

pdf = client.generate(
    template_id="tmpl_abc123",
    data={"customerName": "Alice", "amount": 99.99},
)

print("PDF URL:", pdf.url)
Go
package main

import (
    "fmt"
    "os"
    ds "github.com/documentstack/sdk-go"
)

func main() {
    client := ds.NewClient(os.Getenv("DS_API_KEY"))

    pdf, err := client.Generate(ds.GenerateParams{
        TemplateID: "tmpl_abc123",
        Data: map[string]interface{}{
            "customerName": "Alice",
            "amount":       99.99,
        },
    })
    if err != nil {
        panic(err)
    }

    fmt.Println("PDF URL:", pdf.URL)
}

Common Features

All SDKs share these capabilities:

  • Authentication — API key passed once at client creation
  • PDF generation — Generate PDFs from templates with dynamic data
  • Template management — List and retrieve templates
  • Project management — List and manage projects
  • Error handling — Typed errors with status codes and messages
  • Automatic retries — Configurable retry logic for transient failures
All SDKs are open source. Contributions are welcome on GitHub.

Next Steps