feat(twilio): add Twilio provider (SMS/MMS/WhatsApp) (v1.18.0) - #1
Merged
Conversation
Official Twilio Programmable Messaging integration mirroring the cloud-api provider shape: single endpoint, multi-tenant via per-call credentials (subaccounts), HTTP Basic auth (Account SID + Auth Token or API Key pair). - messaging: send/sendSms/sendMms/sendWhatsApp/sendContentTemplate, get, list/listNextPage, redact, delete (whatsapp: prefixing handled; from or messagingServiceSid interchangeable) - media: list/getInfo/download (follows 302 to CDN)/delete - account: getAccount/listPhoneNumbers/listMessagingServices/listSubaccounts/ verifyConnection - parseTwilioWebhook: normalizes inbound + status callbacks (form-encoded), channel (SMS/WHATSAPP) inferred from address prefix - validateTwilioSignature: full X-Twilio-Signature HMAC-SHA1 scheme, zero-dep, constant-time compare - TwilioApiError + TWILIO_ERROR_CODES (sync + async ErrorCode); isRetryable - TwiML builders: messagingResponse/emptyMessagingResponse/redirectResponse - registered in provider registry / parseWebhook / validateWebhookSignature - docs/providers.md section, README quick start, CHANGELOG, examples/twilio Express app + offline smoke test (19/19 passing) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Twilio Programmable Messaging provider (SMS, MMS, WhatsApp), completing the long-standing "Coming Soon" entry. Architecturally mirrors the Meta Cloud API provider: single endpoint (
https://api.twilio.com/2010-04-01), multi-tenant via per-call credentials (Twilio subaccounts), HTTP Basic auth with either Account SID + Auth Token or an API Key pair.What's included
Provider (
packages/core/src/providers/twilio/)client.js—TwilioProvider, auth resolution, form-urlencodedrequest()messaging.js—send,sendSms,sendMms,sendWhatsApp,sendContentTemplate,get,list,listNextPage,redact,deletemedia.js—list,getInfo,download(follows the 302 to the CDN),deleteaccount.js—getAccount,listPhoneNumbers,listMessagingServices,listSubaccounts,verifyConnectionwebhooks.js—parseTwilioWebhook(inbound + status callbacks, form-encoded),validateTwilioSignature(fullX-Twilio-SignatureHMAC-SHA1, zero-dep, constant-time)errors.js—TwilioApiError+TWILIO_ERROR_CODES+isRetryabletwiml.js—messagingResponse,emptyMessagingResponse,redirectResponseaddresses.js— channel-address helpers (extracted to avoid a circular require)Integration — registered in the provider registry /
parseWebhook/validateWebhookSignature; exported fromsrc/index.js;exportsmap + version bump to 1.18.0.Docs & examples — full section in
docs/providers.md, README quick start + channel table, CHANGELOG entry, and a runnableexamples/twilioExpress app with an offline smoke test.Design note
The generic
validateWebhookSignature(provider, payload, sig, secret)dispatcher doesn't carry the request URL, but Twilio signs URL + sorted params. For Twilio,payloadis{ url, params }(documented in JSDoc +docs/providers.md). The idiomatic path remains the dedicatedvalidateTwilioSignature(url, params, sig, authToken).Verification
packages/core/src, 0 warnings in Twilio filesaddresses.js)🤖 Generated with Claude Code