Skip to main content
The Darwin JavaScript SDK is generated from the reviewed public OpenAPI contract and ships TypeScript types. This page defines the client surface and runtime behavior; use the API reference for endpoint schemas.

Client

Create one DarwinClient per service configuration and reuse it. Resource clients are exposed lazily from the root client.

Configuration

The generated client supports:
  • token — a bearer token or token provider
  • environment or baseUrl — production by default, or an explicit API origin
  • timeoutInSeconds — the default request timeout
  • maxRetries — the default retry ceiling
  • headers — additional headers sent with every request
  • logging and fetch customization supported by the generated runtime

Resource clients

The public product name is Connect; applications remains the generated client property for compatibility with the current API contract.

Naming and return types

JavaScript methods use camelCase. Request and response objects are fully typed from the OpenAPI schema.
Import public models from the package when you need to annotate application boundaries; otherwise let TypeScript infer types from method results.

Passthrough requests

darwin.fetch() uses the SDK’s configured authentication and transport behavior for endpoints that are not yet represented by a generated method.
Prefer a generated resource method when one exists because it provides schema validation and typed results.

Failures and retries

Non-success responses and transport failures raise generated SDK errors. Retries are limited to eligible transient failures; validation or authorization errors are returned immediately. Per-request options can override timeout, retries, headers, or an abort signal.
Retries can repeat a request. Use stable idempotency behavior for create or action methods and do not retry authorization or validation failures blindly.
See Errors for the public error model and Python and TS Cheat Sheets for common method mappings.