Wocha Docs

TypeScript SDK

Server-side Management API client for Node.js and TypeScript.

The @wocha/sdk package is the TypeScript client for the Wocha Customer (Management) API. Use it in backend services, scripts, and serverless functions.

Installation

pnpm add @wocha/sdk
Or scaffold with the CLI
npx @wocha/cli init --framework nextjs

Quick start

import { WochaClient } from "@wocha/sdk";
 
const wocha = new WochaClient({
  tenant: "acme",
  apiKey: process.env.WOCHA_API_KEY!,
});
 
const { data: users } = await wocha.users.list({ page_size: 25 });
console.log(users);

Configuration

Use tenant for Wocha Cloud — the SDK resolves the API base URL automatically:

new WochaClient({ tenant: "acme", apiKey: "..." });
// → https://acme.api.wocha.ai/v1

Use baseUrl for self-hosted deployments:

new WochaClient({
  baseUrl: "https://your-domain.com/v1",
  apiKey: "...",
});

Pass a management API key (wocha_mgmt_...) or an OAuth 2.0 access token with the required scopes.

Try it

Loading playground…

Resources

The client exposes typed resources including:

  • users — create, list, update, delete identities
  • organisations — org membership and hierarchy
  • applications — OAuth client management
  • webhooks — register endpoints and event subscriptions
  • connections — social and enterprise SSO
  • permissions — SpiceDB relationship checks

Learn more

On this page