SDK ReferenceTypeScript
SonnyLabsClientOptions
Constructor options bag for SonnyLabsClient — apiKey, baseUrl, apiVersion, timeoutMs, maxRetries, and the fetch / userAgent overrides.
SonnyLabsClientOptions is the constructor argument for
SonnyLabsClient. Only
apiKey is required; everything else has a sensible default chosen for
the SaaS endpoint.
import { SonnyLabsClient } from "@sonnylabs/sdk";
const client = new SonnyLabsClient({
apiKey: process.env.SONNY_API_KEY!,
baseUrl: "https://sonny.internal.example.com", // self-hosted
maxRetries: 5,
timeoutMs: 30_000,
});Fields
Prop
Type
SonnyLabsClient
The main @sonnylabs/sdk client class — constructor, scan methods, identity and API-key endpoints, and the underlying openapi-fetch escape hatch.
Error classes
The typed error hierarchy thrown by SonnyLabsClient — SonnyLabsError plus per-namespace subclasses for auth, scope, validation, idempotency, rate-limit, not-found, and server errors.