Get started / SDKs
SDKs
Official libraries that wrap the CatzPrint API, so printing from your code is one call. All five work the same way and are tested against the live API.
Install
Pick your language. Every SDK reads your API key from CATZPRINT_API_KEY if you don't pass one.
npm install catzprintPrint your first job
Create an API key in the console under API keys. Use a cz_test_ key while you build: test jobs go to your printers but are never billed.
import { CatzPrint } from "catzprint";
const cz = new CatzPrint({ apiKey: process.env.CATZPRINT_API_KEY });
// Each printer has an id, station and location. Optional: copy a printer's ID
// from the console (Locations & stations → a station → click the ID under its name).
const printers = await cz.printers.list();
const job = await cz.printText("Hello from CatzPrint!", { printerId: printers[0].id });
const done = await cz.jobs.waitFor(job.id);
console.log(done.status); // "printed"What every SDK does
| Feature | Details |
|---|---|
| Print helpers | Text, receipt commands, templates with data, PDF and images. Send to a printer, a location or a role such as receipt. |
| Wait for a job | waitFor polls until the job is printed, failed or cancelled. |
| Jobs | Get, list (with automatic paging), cancel, retry and reprint. |
| Lookups | Printers, locations, templates, and which organization your key belongs to. |
| Safe retries | Network errors, 429 and 5xx are retried with backoff. Every print carries an idempotency key, so a retry never prints twice. |
| Typed errors | Authentication, permission, validation, not found, out of prints, rate limit and server errors, each with the API's message. |
| Webhooks | verify checks the CatzPrint-Signature header (HMAC-SHA256, constant time, 5-minute tolerance). |
| End-to-end encryption | Pass sealed: true and the document is encrypted on your machine to the server key before it is sent. |
| Local printing (offline) | Print through a CatzPrint Station on the restaurant's network when the internet is down, with cloud fallback (local_first, cloud_first). See Local printing. |
TipNever put an API key — test or live — in a browser or mobile app. Call CatzPrint from your server.
End-to-end encryption
Add sealed: true to any text, PDF, image or file print. The SDK fetches CatzPrint's public key once, encrypts the document on your machine (NaCl sealed box: X25519 + XSalsa20-Poly1305) and sends only the encrypted bytes. The server opens it, seals it again to the receiving station's own key, and stores it encrypted. Nobody on the network can read it.
// Encrypted on this machine before it leaves your server.
await cz.printPdf("./payslip.pdf", { printerId, sealed: true });
await cz.printText("Door code: 4821", { role: "receipt", sealed: true });TipReceipt commands and templates can't be sealed, because the server has to lay them out. Everything is still sent over TLS and stored encrypted. Details: How CatzPrint encrypts.
Packages and versions
| Language | Package | Needs | Version |
|---|---|---|---|
| Node.js / TypeScript | catzprint | Node 18+, no dependencies | 2.2.0 |
| Python | catzprint | Python 3.9+, sync and async clients | 2.2.0 |
| PHP | catzprint/catzprint-php | PHP 8.1+, ext-curl and ext-openssl (ext-sodium for sealing, ext-sockets for mDNS) | 2.2.0 |
| Go | github.com/Catalizo/catzprint-go-sdk/v2 | Go 1.26+ | 2.2.0 |
| Rust | catzprint | Rust 1.82+, async (tokio) or the blocking feature | 2.2.0 |
Can't use an SDK? Everything they do is plain HTTPS, described in the API reference.