// @bun
var d=Object.defineProperty;var n=(o)=>o;function c(o,t){this[o]=n.bind(null,t)}var l=(o,t)=>{for(var i in t)d(o,i,{get:t[i],enumerable:!0,configurable:!0,set:c.bind(t,i)})};var p=(o,t)=>()=>(o&&(t=o(o=0)),t);import r from"@contractspec/lib.ui-link";import{ChevronRight as s}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";function h(){return a("div",{className:"space-y-8",children:[a("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"WhatsApp Meta"}),e("p",{className:"text-muted-foreground",children:"Meta WhatsApp is the primary WhatsApp channel for ContractSpec's messaging runtime, with signed webhook verification and reliable outbound delivery."})]}),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
{
  "accessToken": "...",
  "appSecret": "...",
  "verifyToken": "..."
}

// required connection config
{
  "phoneNumberId": "120000000001",
  "apiVersion": "v22.0"
}`})})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Webhook endpoints"}),a("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[a("li",{children:["Verification challenge:"," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"GET /webhooks/whatsapp/meta"})]}),a("li",{children:["Inbound messages:"," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"POST /webhooks/whatsapp/meta"})]}),a("li",{children:["Signatures are validated with"," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-hub-signature-256"}),"."]})]})]}),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_META={"120000000001":"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:"Keep verify and app secrets separate from access tokens."}),e("li",{children:"Map each phone number ID to a workspace for strict tenant routing."}),e("li",{children:"Use Twilio WhatsApp only as fallback when you need active-passive routing."})]})]}),a("div",{className:"flex items-center gap-4 pt-4",children:[e(r,{href:"/docs/integrations/github",className:"btn-ghost",children:"Previous: GitHub Messaging"}),a(r,{href:"/docs/integrations/whatsapp-twilio",className:"btn-primary",children:["Next: WhatsApp Twilio ",e(s,{size:16})]})]})]})}export{h as IntegrationsWhatsappMetaPage};
