Repository navigation
Breaking changes
This release brings the SDK into alignment with the current API contract. Types that were silently broken now match what the API emits; some method return shapes have changed.
Response envelope
- `client.request()` now auto-unwraps the API's `{success, data, requestId}` envelope. Every resource method now returns the shape its type describes.
Fields & names
- `MessageContent.media` → `mediaUrls` to match the API field name. The old field was silently dropped on send.
- `Message.from` and `Message.updatedAt` relaxed to optional (the API doesn't always include them).
- `MessageEventData` introduced to describe the flattened payload the API actually sends in webhook/event `data`.
Return shapes
- `messages.send()` / `messages.sendCarousel()` now return `SendMessageResult` (the partial 202-Accepted record), not a pretend full `Message`.
- `messages.list()` / `messages.listScheduled()`: normalize the API's nested `{messages, pagination}` into `{data, hasMore, nextCursor}`.
- `contacts.list()`: `{contacts}` → `{data}`.
- `payments.list()`: `{requests, pagination}` → `{data, hasMore, nextCursor}`.
- Phantom `total` / `limit` / `offset` fields removed from `MessageList` / `ContactList` / `PaymentRequestList` — the API never emitted them.
WebhookEventType
- Removed events the API does not emit: `reaction.added`, `reaction.removed`, `typing.started`, `typing.stopped`, `message.received`.
- Added events the API does emit: `message.queued`, `message.fallback`, `message.inbound`, `message.edit_failed`, `webhook.test`.
- `ReactionWebhookEvent` kept as a deprecated alias of the `message.reaction` variant of `MessageWebhookEvent`.
New features
- `client.numbers.list()` — returns the customer's authorized sender addresses (phone numbers + iMessage emails) as `SenderNumber[]`.
- Realtime events (SSE) — the API gained a `GET /v1/events` endpoint (v0.3.0 of the API). The existing `TextBubblesEventClient` now talks to a real endpoint; same event envelope and types as webhooks. See the README "Receiving incoming messages" section.
Fixes
- `numbers.list()` no longer double-unwraps (the centralized envelope unwrap handles it).
Migration
Most consumers will compile immediately. If you previously relied on:
- `MessageContent.media` — rename to `mediaUrls`.
- `result.total` on a list response — remove; use `hasMore` + `nextCursor` for pagination instead.
- Webhook event types `reaction.added` / `reaction.removed` / `typing.started` / `typing.stopped` / `message.received` — switch to `message.reaction` (with `data.reaction`), `typing.indicator`, or `message.inbound` respectively.