Skip to content
SMS SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Changelog

Release history for @opencoredev/sms-sdk.

This page summarizes CHANGELOG.md in the repository, which is the canonical record.

Unreleased

  • sms.getMessage(providerId, { adapter?, signal? }) looks a message up with the provider and returns its delivery, or undefined when the provider has no such message. Failures throw MessageLookupError (retrySafe: false). Every built-in adapter implements the new optional SmsAdapter.getMessage; Vonage reads the Reports API and needs reportsCredentials with JWT auth. capabilities() reports messageLookup.
  • parseSmsWebhooks() returns every event in a request: each element of a Bandwidth callback and each Sinch recipient_delivery_report entry. parseSmsWebhook() now throws WebhookPayloadError for a multi-event payload instead of returning only the first Sinch report. Bandwidth status callbacks include the recipient in dedupeKey (bandwidth:{messageId}:{to}:{type}).
  • fromByAdapter on send() input sets a sender per adapter, for fallback chains.
  • Suppression lists: SuppressionList, memorySuppressionList(), suppressionPolicy() for beforeSend, and applySuppressionEvent() for STOP and START webhooks. See STOP, HELP, and opt-outs.
  • Keyword events (recipient.opted_out, recipient.opted_in, recipient.help) carry mediaUrls.
  • createSmsClient rejects idempotency.ttlSec and staleReservationSec that are not whole numbers of seconds of at least 1 (a ttlSec of 0 let a repeated key send twice), timeoutMs above 2147483647, malformed idempotency/retry objects, retry.maxAttempts outside 1 to 10, and retry delays outside 0 to 2147483647. send() throws ConfigurationError if idempotency.store.reserve() throws or returns a malformed record/result, and memory(), memory().enqueue(), and the suppression helpers throw ConfigurationError for malformed inputs. Sinch expire_at now anchors to sendAt when both sendAt and validityPeriodSec are set.
  • validate() returns issues instead of throwing for malformed runtime input (a non-object message, a non-array mediaUrls, a non-string idempotencyKey), and send() throws InvalidMessageError for it.
  • createSmsClient, all adapter factories (twilio, telnyx, plivo, vonage, bandwidth, sinch), send(), getMessage(), and the webhook parsers and verify helpers throw ConfigurationError for missing or malformed options, malformed adapters (including capabilities.senderTypes, capabilities.validityPeriod, and providerOptions specs), invalid fallback/hooks/beforeSend, invalid or non-http(s) baseUrl (including credentials, query, fragment, or Unicode whitespace/control characters) or publicUrl (including credentials, bare ?, fragment, or Unicode whitespace/control characters; non-empty query strings remain supported), invalid Vonage region, non-function fetch or now, spoofed or non-AbortSignal signal, dot-segment providerId ("." or ".."), missing/malformed/locked webhook request, unsupported webhook provider, empty Basic/HMAC/verify-helper secrets, invalid or non-http(s) URLs in Twilio/Plivo verify/compute helpers, unknown Sinch webhook credentials.kind, non-Latin-1 Basic credentials, and invalid toleranceSec (NaN, non-finite, negative, or non-number). MessageLookupError#toJSON(), WebhookSignatureError#toJSON(), WebhookPayloadError#toJSON(), and HandoffUnknownError#toJSON() include providerName and reason when present. SinchWebhookVerification is exported from @opencoredev/sms-sdk/webhooks. Twilio error code 30007 maps to filtered, Sinch Rejected delivery status maps to undelivered unless the error code is 40003 (filtered), and each Sinch recipient_delivery_report event takes occurredAt from that report’s at.
  • Plivo rejected status maps to undelivered in webhooks and getMessage(), and placeholder ErrorCode/error_code 000 is omitted.
  • beforeSend fails closed with PolicyRejectedError on malformed or unrecognized decisions without stranding idempotency reservations, and throwing inside beforeSend now emits onFailure. An unexpected internal failure keeps the attempts already made.
  • unsafeSkipVerification throws ConfigurationError when NODE_ENV is production.
  • Provider responses and inbound webhook request bodies are read up to 1 MiB; an oversized provider response is an unknown outcome, an oversized webhook body throws WebhookPayloadError (reason: "body_too_large") before signature verification, and an aborted or unreadable webhook body stream throws WebhookPayloadError (reason: "body_unreadable").
  • Every subpath export has a default condition beside import. The package stays ESM only.
  • send(), validate(), createSmsClient(), adapter factories, and webhook parsers snapshot caller-supplied inputs and options upfront (preserving class-instance hooks, fromByAdapter, and factory/sender getters), deep-freeze exported capability constants and capabilities()/defaultFrom copies, validate Date and RegExp brand slots, require plain objects for providerOptions entries and extra, trim only HTTP OWS around trustProxy headers, and treat non-string verifyTelnyxSignature/verifySinchSignature inputs as invalid signatures.
  • Provider error details (error.provider.code, error.provider.requestId) and serialized providerName fields keep compact structural tokens and opaque hex IDs while dropping free-form text, credential-shaped tokens, and phone-length digit runs (in-memory error.providerName keeps the registered adapter name, and SmsError#toJSON() clones attempts and provider).
  • Concurrent same-key send() calls coalesce synchronously with per-caller result and AbortSignal isolation; SendAbortedError and HandoffUnknownError preserve each caller’s signal.reason as cause.
  • Retry-After header parsing enforces strict RFC 9110 delta-seconds and calendar-exact HTTP-dates (IMF-fixdate, RFC 850 with the 50-year rule, and asctime), Sinch rejects overflowing sendAt + validityPeriodSec timestamps during validation, and overflowing Retry-After values stop retrying instead of falling back to backoff.

0.1.1

  • The docs site is the package homepage, and the package README has the SMS SDK banner with its Contributing and Examples links pointing at GitHub.
  • README: why Bandwidth and Sinch are partial, and which providers have signed webhook request builders.

0.1.0

First public version.

  • providerOptions on send() input: typed per-adapter provider parameters plus an unvalidated extra passthrough. Unknown keys, wrong types, and parameters the SDK sets throw before any request. Each entry applies only to its own adapter, is listed in validate().providerOptionsFor, and is part of the idempotency fingerprint. Adapters declare options with SmsAdapter.providerOptions and receive them as AdapterMessage.providerFields.
  • createSmsClient with send(), validate(), and capabilities(). send() resolves only on provider acceptance. Rejections and unknown outcomes throw typed errors with code, retrySafe, and redacted attempts.
  • Adapters: Twilio (supported), Telnyx (supported), Plivo (partial), Vonage Messages API with Basic or JWT auth (partial), Bandwidth (partial), and Sinch (partial).
  • Opt-in fallback (fallback: "on-known-rejection") for auth, rate_limited, sender, and account rejections only, never after an unknown outcome.
  • Rate-limit retries with exponential backoff, full jitter, and bounded Retry-After. A 429 counts as a rate limit only with the provider’s documented rate-limit error. Any other 429 is an unknown outcome.
  • Per-request timeout and AbortSignal support.
  • The IdempotencyStore contract with atomic reserve and owner-checked finalize, plus memoryIdempotencyStore().
  • GSM-7 and UCS-2 segment estimates, including extension characters and surrogate pairs at segment boundaries.
  • /webhooks: verified, normalized events for every provider, with dedupe keys and STOP/HELP detection.
  • /testing: the memory() adapter, mockFetch(), signed webhook request builders for Twilio, Telnyx, Plivo, and Vonage, and runSmsAdapterContract().
  • sms-sdk doctor: a dry-run configuration check with a gated --live send.

Last updated on