Skip to content
  • sdk
  • cli
  • api

Upgrading to samva 0.27: changes since 0.11

Moving from samva 0.11 to 0.27 renames mailbox calls, changes contact and sender setup, and reshapes template and usage responses. Check these changes.

Many of these changes are live on the REST API too. Search your code for the old names below, then let the type checker find the rest. If you upgrade one release at a time, each version's notes are in the package changelog.

What you need to do

  1. Mailbox streams. The stream now pings every 30 seconds instead of sending heartbeats. Upgrade the SDK or CLI before you rely on a long-lived stream, or an older one reconnects about every 90 seconds (0.12).
  2. Contacts. contacts.bulkImport takes identities and profile and an onConflict of skip or update. findOrCreate takes a lookup and returns { contact, created } (0.13, 0.14). An identity has a type of email or phone where it had a channel (0.19).
  3. Mailbox sends. A send, reply or forward returns a receipt with a state, such as queued or completed, in place of status (0.14). A mailbox owns endpoints (0.15, 0.16):
// Before
await samva.mailboxes.create({
  slug: "support",
  displayName: "Support",
  addresses: [{ address: "support@acme.samva.email" }],
});

// After
await samva.mailboxes.create({
  endpoint: { channel: "email", address: "support@acme.samva.email" },
  name: "Support",
});
  1. Default sender. An organization has one default sender, and domains carry none (0.16):
// Before
await samva.email.setDomainDefaultSender({ id: domainId, senderId });

// After
await samva.email.setDefaultSender({ id: senderId });
  1. Unsubscribe groups. Members are contacts. addEmails is addMembers, removeEmails is removeMembers, and each takes { contactId }, { email } or { phone } (0.19).
  2. Templates. Publications return compiled where they returned ir, and a brand's footer is one renderedFooter (0.23). Template, API key and campaign run responses carry new required fields, so update test fixtures (0.21).
  3. Usage. Organization usage reports includedCredits, usedCredits and overageCredits where it reported email counts, with AI credits in separate fields (0.23).
  4. Sends without a sender. A send with no from and no default sender throws FromAddressRequiredError, whose verifiedDomains lists what you can use (0.24).
  5. Effect users. Client.raw is gone. Call the domain operation, such as Contacts.list(...) from samva/effect/contacts (0.17).

Also in this range: Promise request types accept undefined inside free-form objects such as templateData, and list parameters accept two or more items (0.23.1).

Links

Related

All changelog entries