Skip to main content
The SW Combine SDK is written in TypeScript 5.5+ strict mode and ships its own type definitions at dist/types/index.d.ts. Every method returns a fully typed response — you rarely need to annotate types yourself, but you can import any type or enum directly when you want explicit annotations or need to reference specific values.

Installing and importing

The SDK supports both ESM (import) and CommonJS (require). Import the client and any types you need from the same package entry point:
All types are re-exported from swcombine-sdk. You do not need to import from dist/types/index.d.ts directly.

Enum reference

The SDK exports two enums that you pass as parameters to API calls.

MessageMode

Controls which mailbox to query when listing messages.

AccessType

Passed in ClientConfig to choose whether the OAuth flow issues a refresh token.

Explicit type annotations

TypeScript infers return types automatically, but you can annotate variables when you want to make contracts explicit or pass data to other functions.

Single-entity responses

Paginated list responses

Every list() method returns Page<T>. Annotate with the specific item type if you need to pass the page to a typed function:

Error handling with SWCError

All API errors are thrown as SWCError instances. Import the class to narrow the type in catch blocks:

Scope types

When building OAuth authorization URLs you pass an array of scopes. The SDK exports typed scope constants so you never mistype a scope string:
Helper functions are also available if you want predefined scope sets:

Full exported type reference

The following types and interfaces are exported from swcombine-sdk: Core response types Galaxy types Configuration and utility types Enums