ProblemEnvelope
The duck-typed RFC 9457 application/problem+json shape the SDK consumes, plus the per-field ProblemFieldError used by validation errors.
The SDK keeps the Problem shape duck-typed (rather than depending
directly on the generated OpenAPI schema) so it imposes no hard
runtime dependency on the generated types. The generated
components["schemas"]["Problem"] is structurally compatible with this
interface, and the raw envelope is preserved on every
SonnyLabsError under the problem
property for forward compatibility with future fields.
ProblemEnvelope
Prop
Type
ProblemFieldError
Single per-field validation problem, returned in the errors array on
ValidationError.
Prop
Type
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.
verifyWebhook
Constant-time HMAC-SHA256 verification for inbound Sonny Labs webhook deliveries, plus VerifyWebhookOptions for replay-window tolerance and clock injection.