Skip to main content
The @kansato/whistle-sdk package is the typed server-side client for the Whistle SDK HTTP API (/sdk/whistle/v1). Pair it with Outbound webhooks verification helpers on the same install. For browser-side case reporting UI, use the hosted iframe-backed React SDK with a publishable key instead of sending your secret key to the client.

Install

Setup

  • apiKey — secret key (sk_live_) from Settings → Developer → API Keys. Never ship this to browsers; use pk_live_ only with the React SDK.
  • projectId — project UUID from the dashboard.
Optional configuration:

Error handling

All methods throw WhistleError on non-2xx responses and network failures.
WhistleError properties:

Reports

Create a report

subject is the person who authored the content being reported. reporter is optional and identifies who filed the report. The reason field accepts a string, an array of strings, or an explicit { names: string[] } object:

List reports

Returns PaginatedResponse<Report>:

Get a single report

Resolve and reopen

Both return void on success. They throw WhistleError if the report is not found.

Dismiss

Valid dismiss reasons: false_positive, duplicate, out_of_scope, not_actionable, other.

Escalate

Valid escalation targets: safety, legal, senior_moderator.

Identities

List identities

Returns PaginatedResponse<Identity>.

Upsert an identity

Returns the full Identity object. Creates the identity if it does not exist, or updates display fields and metadata if it does.

Report reasons

List report reasons

Returns the project’s configured report reasons. Accessible with both secret and publishable keys.

Content flag detection

Kuro AI content scoring uses organization REST routes (/api/v1/organizations/.../content), not the SDK class surface. Call fetch or your HTTP client from the same backend that holds the secret key. See Kuro AI for payloads and responses.