// @bun
var r=Object.defineProperty;var n=(o)=>o;function c(o,t){this[o]=n.bind(null,t)}var p=(o,t)=>{for(var i in t)r(o,i,{get:t[i],enumerable:!0,configurable:!0,set:c.bind(t,i)})};var s=(o,t)=>()=>(o&&(t=o(o=0)),t);import d from"@contractspec/lib.ui-link";import{ChevronRight as l}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";function g(){return a("div",{className:"space-y-8",children:[a("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"WhatsApp Twilio"}),e("p",{className:"text-muted-foreground",children:"Twilio WhatsApp support provides a durable fallback channel with signature verification and outbox-backed outbound dispatch."})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`// secret payload
{
  "accountSid": "AC123",
  "authToken": "..."
}

// optional connection config
{
  "fromNumber": "whatsapp:+15550002"
}`})})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Webhook ingress"}),a("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[a("li",{children:["Inbound Twilio form payloads are accepted on"," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"/webhooks/whatsapp/twilio"}),"."]}),a("li",{children:["Signatures are validated with"," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-twilio-signature"})," ","and the configured auth token."]}),a("li",{children:["For deterministic verification, set the exact public webhook URL in"," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"WHATSAPP_TWILIO_WEBHOOK_URL"}),"."]})]})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Workspace mapping"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:'CHANNEL_WORKSPACE_MAP_WHATSAPP_TWILIO={"AC123":"workspace-acme"}'})})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Best practices"}),a("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[e("li",{children:"Use Twilio as fallback when Meta WhatsApp is your primary route."}),e("li",{children:"Keep account SID mapping explicit to avoid tenant misrouting."}),a("li",{children:["Protect internal dispatch endpoints with",e("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"CHANNEL_DISPATCH_TOKEN"}),"."]})]})]}),a("div",{className:"flex items-center gap-4 pt-4",children:[e(d,{href:"/docs/integrations/whatsapp-meta",className:"btn-ghost",children:"Previous: WhatsApp Meta"}),a(d,{href:"/docs/integrations/health-routing",className:"btn-primary",children:["Next: Health Routing ",e(l,{size:16})]})]})]})}export{g as IntegrationsWhatsappTwilioPage};
