@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; usepk_live_only with the React SDK.projectId— project UUID from the dashboard.
Error handling
All methods throwWhistleError 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
PaginatedResponse<Report>:
Get a single report
Resolve and reopen
void on success. They throw WhistleError if the report is not found.
Dismiss
false_positive, duplicate, out_of_scope, not_actionable, other.
Escalate
safety, legal, senior_moderator.
Identities
List identities
PaginatedResponse<Identity>.
Upsert an identity
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.
