Client SDK · State and data

Feedback and devices.

Report harmful content and manage push notification devices.

Feedback

feedback.report(params, options?)

Reports a message for harmful, inaccurate, off-topic, or privacy-violating content.

TypeScript
await client.feedback.report({
  messageId: 'msg-456',
  conversationId: 'conv-123',
  reason: 'inaccurate',
  comment: 'The capital of Australia is Canberra, not Sydney.',
});

Parameters

Fieldtypedescription
messageIdstringThe message being reported.
conversationIdstringThe conversation containing the message.
reason'harmful' | 'inaccurate' | 'off_topic' | 'privacy' | 'other'Report reason.
commentstringOptional additional context.

Returns Promise<{ reportId: string; acknowledgedAt: string }>.

feedback.response(params, options?)

Submits general response feedback (positive/negative sentiment with platform context).

TypeScript
await client.feedback.response({
  messageId: 'msg-456',
  conversationId: 'conv-123',
  comment: 'Great answer!',
  platform: 'web',
  appVersion: '1.0.0',
});

Parameters

Fieldtypedescription
messageIdstringThe message being rated.
conversationIdstringThe conversation containing the message.
commentstringOptional feedback text.
platform'web' | 'ios' | 'android' | 'unknown'Client platform.
appVersionstringApp version string.
buildNumberstringBuild number.

Returns Promise<{ feedbackId: string; acknowledgedAt: string }>.

feedback.reportBug(params, options?)

Files a bug report from your application. Reports land as GitHub issues in the internal feedback repository — titled [SDK] <title> and labelled sdk-feedback — so engineering can triage them directly.

The SDK automatically stamps the report with its package name (@maincode-ai/matilda-client-sdk), package version, and — in Node — the Node.js version, so you usually only need title and description. Pass the optional fields to override or supply anything else.

TypeScript
await client.feedback.reportBug({
  title: 'stream() silently closes on 429',
  description: 'The stream closes without error when the API returns 429.',
  reproduction: 'Call chat.stream() in a loop until rate-limited; observe the close event.',
});

Parameters

Fieldtypedescription
titlestringOne-line summary of the bug (required, max 200 chars).
descriptionstringWhat went wrong (required, max 4000 chars).
reproductionstringOptional steps to reproduce (max 4000 chars).
packagestringReporting package name — defaults to this SDK's package name.
packageVersionstringReporting package version — defaults to this SDK's version.
nodeVersionstringNode.js version — auto-detected in Node, omitted in browsers.
platform'web' | 'ios' | 'android' | 'unknown'Client platform.
appVersionstringYour application's version string.
idempotencyKeystringOptional key (max 128 chars) so retries don't create duplicate issues.

Returns Promise<{ feedbackId: string; acknowledgedAt: string }>.

Devices

devices.register(device, options?)

Registers a push notification device.

TypeScript
await client.devices.register({
  expo_push_token: 'ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]',
  device_id: 'device-uuid-123',
  platform: 'ios',
  app_version: '1.0.0',
});

PushDevice

Fieldtypedescription
expo_push_tokenstringExpo push notification token.
device_idstringUnique device identifier.
platform'ios' | 'android'Device platform.
app_versionstringApp version.

Returns Promise<{ status: string }>.

devices.list(options?)

Lists all registered push devices for the current user.

TypeScript
const devices = await client.devices.list();
for (const device of devices) {
  console.log(`${device.platform}: ${device.expo_push_token}`);
}

Returns Promise<PushDevice[]>.

devices.unregister(expoPushToken, options?)

Unregisters a push device by its Expo push token.

TypeScript
await client.devices.unregister('ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]');

Returns Promise<{ deleted: boolean }>.