Skip to main content

Setup

Install @addresszen/sdk and create a client with your API key. The SDK runs in browsers and Node.js 22 or later and uses the runtime's native fetch.

npm install @addresszen/sdk
client.tsts
import { createZenClient } from "@addresszen/sdk";

const client = createZenClient({ apiKey: "ak_test" });

Which options does the client take?​

OptionTypePurpose
apiKeystringRequired API key, sent as api_key
userTokenstringManagement Key for account operations. Keep it on your server
baseUrlstringDefaults to https://api.addresszen.com/v1
fetchtypeof fetchCustom fetch implementation for tests or request handling

When do I need a Management Key?​

Set userToken to a Management Key only to call the account operations that need it: key details, usage and logs, licensees and configs. Each operation page says whether it needs one. A Management Key controls your account, so keep it on your server and never use it in a client that runs in the browser. The SDK sends it in the Authorization header, and only to operations that accept it.

What else do I need to install?​

The root package has no runtime dependencies. Install @tanstack/react-query or @tanstack/preact-query only when using the matching adapter.

Which module formats are supported?​

TypeScript consumers can use either NodeNext or bundler module resolution. CommonJS consumers can use require("@addresszen/sdk"). Use ESM imports for tree-shaking.