SDKs

Three official clients, same contract. Pick one, install, set LEGALIZE_API_KEY in your environment, and Legalize() just works — no constructor arguments.

Python

PyPI package legalize. Supports Python 3.10 through 3.13. Sync and async clients share the same resource API. Models are Pydantic v2 generated from the OpenAPI spec.

install
pip install legalize

Two client classes: Legalize (sync, wraps httpx.Client) and AsyncLegalize (async, wraps httpx.AsyncClient). Resource namespaces — client.laws, client.webhooks, etc. — look identical on both.

Node / TypeScript

npm package @legalize-dev/sdk. Requires Node 20+. Zero runtime dependencies — uses built-in fetch, AbortController, and crypto. Ships dual ESM + CJS bundles with .d.ts files.

install
npm install @legalize-dev/sdk

Promise-based client. Iterators are AsyncIterableIterator so for await (const law of client.laws.iter(...)) just works. Tree-shaking friendly (named exports only, sideEffects: false).

Go

Module github.com/legalize-dev/legalize-sdks/go. Requires Go 1.22+. Stdlib-only (net/http, crypto/hmac, crypto/subtle). Every I/O method takes context.Context as the first argument; options are functional.

install
go get github.com/legalize-dev/legalize-sdks/go

Typed errors implement a sealed legalize.Error interface; check them with errors.As. Iterators use the pull pattern iter.Next(ctx) (T, bool, error) — no leaked goroutines on early exit.

Contract parity

All three SDKs implement the same cross-language PARITY.md spec: operation list, error tree, retry semantics, webhook scheme, and the environment-variable contract. A change to any one of them requires the same change across the other two, guarded by parallel parity tests in each language's test suite.

Want another language? Email me and I'll add it to the backlog. Every SDK is generated from the same OpenAPI spec, so porting is mostly plumbing.