Skip to main content

Install

npm install @talonic/node

Requires Node.js 18 or newer. Zero runtime dependencies.

The package works with npm, yarn, pnpm, and bun. It ships ESM and CJS builds with full TypeScript declarations, so it integrates cleanly into any modern Node.js project without additional configuration.

The SDK relies on the built-in fetch available in Node.js 18+. If you are running an older Node.js version, pass a fetch polyfill (such as node-fetch) via the fetch constructor option.

Install with other package managers
# yarn
yarn add @talonic/node

# pnpm
pnpm add @talonic/node

# bun
bun add @talonic/node

After installation the talonic CLI binary is available in your project. Run npx talonic --help to verify the install. The CLI mirrors the SDK's resource structure, so you can test your API key from the terminal before writing any code. If you installed globally with npm install -g @talonic/node, the talonic command is available directly without npx.

Get an API key (30 seconds)

Every user runs against their own Talonic workspace. Your documents and schemas are private to you.

  1. Sign up at app.talonic.com. Free tier: 50 extractions per day, no credit card.
  2. Settings → API Keys → Create New Key.
  3. Copy the tlnc_ value.
  4. Set it as the TALONIC_API_KEY environment variable, or pass it directly to the client constructor.
Verify your installation
import { Talonic } from '@talonic/node'

const talonic = new Talonic({ apiKey: process.env.TALONIC_API_KEY! })

// Quick smoke test: check your credit balance
const balance = await talonic.credits.getBalance()
console.log(`Connected! Balance: ${balance.balance_credits} credits (${balance.tier} tier)`)

The constructor validates that the apiKey is a non-empty string and that a fetch implementation is available. It throws a TypeError immediately if either check fails, so you will catch configuration problems at startup rather than on the first API call. The SDK does not validate the tlnc_ prefix or contact the server during construction; authentication errors surface on the first actual request as a TalonicAuthError with status 401 or 403.

Verify from the terminal
# Set your API key
export TALONIC_API_KEY=tlnc_your_key_here

# Test the connection
npx talonic credits balance
# { "balance_credits": 1888, "tier": "pro", ... }
Store your API key in an environment variable or secrets manager. Never commit tlnc_ values to version control.

Frequently asked questions

How do I install the Talonic SDK?+
Run npm install @talonic/node. Requires Node.js 18+ with zero runtime dependencies. Also works with yarn, pnpm, and bun.
How do I get a Talonic API key?+
Sign up at app.talonic.com (free tier, no credit card), then go to Settings > API Keys > Create New Key. Keys use the tlnc_ prefix.
Does the SDK ship ESM and CJS builds?+
Yes. The package includes both ESM and CJS builds with full TypeScript declarations. It integrates into any modern Node.js project without additional bundler configuration, and the types are auto-discovered by TypeScript without manual setup.
How do I verify my installation is working?+
After installing, create a Talonic client with your API key and call talonic.credits.getBalance(). If the call succeeds and returns your balance, the SDK is correctly installed and your key is valid. You can also run npx talonic credits balance from the terminal.