Skip to main content
Available on the Corporate plan. This capability is part of woku’s enterprise features. Talk to our sales team.
The @wokuapp/sdk SDK is the official server-side client for the woku management API. With a single typed client you manage external trackers, VoC tools (NPS, CSAT, CES), wokus, forms, flows, action plans, support tickets, survey sends and delivery tracking, all over the public v1 API.
This is a server-side SDK. The company secret key grants full management access, so it must live only on your backend. Never ship it in a browser bundle, a mobile app or any client you do not control. To capture feedback from a mobile app use the React Native SDK, which uses a public capture key.

Installation

Requires Node.js 18 or later (uses the global fetch). It has zero runtime dependencies.

Initialization

Create a Woku instance once and reuse it.
If you omit apiKey, the SDK reads the WOKU_API_KEY environment variable. You can also pass the key directly: new Woku('sk_...').

Authentication

The SDK authenticates with the Company Key, the same secret key the API uses. The company owner gets it from the company Information section in the admin app: admin.woku.app.
The SDK adds that header for you on every call.

Rotate or revoke the key

Since the secret key grants full access, you can rotate or revoke it from the SDK itself. Rotating generates a new key and immediately invalidates the previous one; store the returned key before continuing.

Quickstart

An end-to-end flow: create a tracker, create an NPS tool, send it and read the response rate.

Main flows

VoC tools

Create and manage NPS, CSAT and CES tools, and capture their responses.

Support tickets

Tickets are generated by woku’s AI. You can list, filter and curate them.

Action plans

Approve plans, send them to an external tool or manage them inside woku.

Pagination

List methods return a Page. Iterate every item across pages, or walk page by page:

Idempotency

Creates carry an automatic Idempotency-Key, so a retry after a transient failure never creates twice. Actions (send, test, reply) are not retried on their own so an effect is never repeated. You can pass your own key per call:

Error handling

Every failure is a WokuError. HTTP errors are typed subclasses carrying the server status, body and requestId:
Transport failures (DNS, TLS, timeout) are WokuConnectionError and WokuTimeoutError. The SDK retries GETs and idempotent writes automatically with backoff, honoring the Retry-After header.

Per-call configuration

Every method accepts overrides in its last argument:

Resources

trackers, npsTools / csatTools / cesTools, nps / csat / ces, wokus, forms, flows, actionPlans, actionPlanGroups, tickets, ticketDestinations, dispatches, reports, company, quarantines.

Versioning

The SDK follows semantic versioning (MAJOR.MINOR.PATCH). The current published version is 0.1.0. We recommend pinning a compatible range (for example ^0.1.0) and reviewing the changelog before a MAJOR bump. Versions and their notes are on the npm package and the GitHub releases.

Resources