Member Junction
    Preparing search index...

    Implementation of the Twilio provider for sending and receiving messages (SMS, WhatsApp, Facebook Messenger)

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get ProviderName(): string

      Returns the name of this provider for use in error messages. Override in subclasses to provide a more descriptive name.

      Returns string

    • get SupportsPush(): boolean

      Convenience gate: true when this provider supports inbound push in ANY form (subscription-managed or inbound-parse), false otherwise. Lets callers cleanly short-circuit — if (provider.SupportsPush) { ... } — instead of probing individual operations.

      Derived from GetSubscriptionCapabilities so it stays in lockstep with actual capability: providers that support push return capabilities and thereby report SupportsPush === true for free; providers that don't return undefined and report false. Subclasses normally do NOT override this — override GetSubscriptionCapabilities instead.

      Returns boolean

    Methods

    • Parses and verifies an inbound Twilio SMS webhook. Pure: no Twilio client, no network. Safe on hostile/garbage input — never throws; returns Success: false with a 400 suggested status when the body cannot be parsed at all.

      Twilio posts application/x-www-form-urlencoded. The X-Twilio-Signature header is verified via the SDK's validateRequest(authToken, signature, url, params) using the account Auth Token (the "Messaging webhook signature" secret). The parsed notification is ALWAYS returned even when the signature is invalid — the flag is set so the consumer can decide — but an unparseable body is the 400 case.

      INLINE mode: the webhook carries the full message, so NormalizedNotification.Message is populated and consumers need not re-fetch. MessageSid is also surfaced in NormalizedNotification.MessageIDs as a still-useful pointer.

      Parameters

      Returns Promise<ParseNotificationResult>

      Promise - The normalized inbound message + signature outcome