Exports.
Every class, interface, and type the client SDK package exports.
Default export
import Matilda from '@maincode-ai/matilda-client-sdk';The Matilda class — the main SDK entry point.
Named exports
| Export | Type | Description |
|---|---|---|
Matilda | class | Main client class. |
MatildaAPIError | class | HTTP error (status, responseText). |
SafetyReplaceError | class | Safety filter replacement error (categories). |
MatildaObjectParseError | class | Structured output parse/validation failure (raw, cause). |
MatildaClientOptions | interface | Constructor options (extends ClientConfig). |
MatildaRequestOptions | interface | Per-request options (signal, stallTimeoutMs, etc.). |
ChatCreateParams | interface | Chat request params (input, messages, conversationId, fileIds, responseMode, responseSchema). |
MatildaChatStreamEvent | type | Discriminated union of 14 stream event types. |
MatildaChatResponse | interface | Collected response from chat.create(). |
MatildaObjectResponse<T> | interface | chat.createObject() response (extends MatildaChatResponse, adds object). |
MatildaObjectEvent<T> | type | chat.streamObject() events — all stream events, plus a final { type: 'object' }. |
ChatResumeParams | interface | Durable stream resume params (streamId, lastEventId). |
FileUploadOptions | interface | File upload options (onProgress + request options). |
BrowserLoginOptions | interface | Browser login (PKCE) options. |
DeviceLoginOptions | interface | Device flow options. |
CreateApiKeyOptions | interface | API key creation params (name, scopes, expiresAt). |
ApiKey | interface | API key metadata (no secret). |
ApiKeyWithSecret | interface | API key with one-time secret. |
TokenSet | interface | OAuth token set (accessToken, refreshToken, idToken, expiresAt). |
StorageAdapter | interface | Pluggable token storage. |
TokenManager | interface | Token manager interface. |
LoginFlowEvent | type | Login flow state events. |
DEFAULT_SUCCESS_REDIRECT | const | Default browser-login success redirect URL. |
client | const | Pre-created singleton Matilda instance (using default config). |
Re-exported types
From @matilda/api-client:
| Export | Type | Description |
|---|---|---|
MatildaCore | class | The underlying HTTP client that powers all resource groups. |
configureClient | function | Configure a shared client instance. |
fetchPublicRuntimeConfig | function | Fetch runtime config from the server. |
getClientConfig | function | Get the current shared client config. |
trustApiBaseUrl | function | Validate and brand a URL as trusted. |
ClientConfig | — | Base client configuration. |
RequestOptions | — | Base request options (fingerprint, accessToken). |
ChatResponseMode | — | 'auto' | 'instant' | 'deep'. |
ChatErrorCode | — | Chat error code union. |
GetToken | — | Token provider function type. |
TrustedApiBaseUrl | — | Branded trusted URL type. |
TrustedApiBaseUrlPolicy | — | URL validation policy. |
PublicConfigEndpoint | — | Public config endpoint union. |
PublicRuntimeConfig | — | Runtime config from server. |
From @matilda/shared-types:
| Type | Description |
|---|---|
ApiMessage | Wire-format message ({ role, content }). |
ChatMessage | Domain message with full metadata. |
ConversationSummary | Conversation list item. |
ConversationListResponse | Paginated conversation list. |
ConversationRecord | Full conversation with messages. |
FileAttachment | File metadata. |
FileCompleteResponse | Upload completion response. |
PushDevice | Push notification device. |
UsageEvent | Token usage event. |
ActiveStreamLookup | Active stream check result. |
Deprecated exports
| Export | Description |
|---|---|
PkceLoginOptions | Use BrowserLoginOptions instead. |
DeviceFlowOptions | Use DeviceLoginOptions instead. |