[{"data":1,"prerenderedAt":6571},["ShallowReactive",2],{"docs-navigation":3,"content-query-IqD0KvvQFf":342},[4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,271,274,277,280,283,285,288,291,294,297,300,303,306,309,312,315,318,321,324,327,330,333,336,339],{"_path":5,"title":6},"/docs/account/account-management","Account management",{"_path":8,"title":9},"/docs/account/mfa","Multi-factor authentication (MFA)",{"_path":11,"title":12},"/docs/account/team","Teams and sub-accounts",{"_path":14,"title":15},"/docs/account/billing-and-subscriptions","Billing & subscriptions",{"_path":17,"title":18},"/docs/account/access-tokens","Webhook Relay access tokens: permissions and subscription scopes",{"_path":20,"title":21},"/docs/clawhub","Webhook Relay on ClawHub",{"_path":23,"title":24},"/docs/email","Receive emails as webhooks",{"_path":26,"title":27},"/docs/email/payload","Email webhook payload",{"_path":29,"title":30},"/docs/email/filtering-and-policy","Sender filtering & policy",{"_path":32,"title":33},"/docs/email/cli","Create & poll email addresses from the CLI",{"_path":35,"title":36},"/docs","Getting Started",{"_path":38,"title":39},"/docs/installation/cli","CLI",{"_path":41,"title":42},"/docs/installation/docker","Docker container",{"_path":44,"title":45},"/docs/installation/docker-compose","Docker Compose",{"_path":47,"title":48},"/docs/installation/kubernetes","Kubernetes",{"_path":50,"title":51},"/docs/installation/autostart-windows","Autostart (Windows)",{"_path":53,"title":54},"/docs/installation/autostart-linux","Autostart (Linux)",{"_path":56,"title":57},"/docs/installation/autostart-macos","Autostart (MacOS)",{"_path":59,"title":60},"/docs/installation/behind-proxy","HTTP proxy configuration",{"_path":62,"title":63},"/docs/mcp","MCP Server",{"_path":65,"title":66},"/docs/outbound","Outbound Gateway: send webhooks to your customers",{"_path":68,"title":69},"/docs/outbound/setup","Set up the Outbound Gateway",{"_path":71,"title":72},"/docs/outbound/receiving","Receive and verify outbound webhooks",{"_path":74,"title":75},"/docs/outbound/operating","Monitor, retry and recover deliveries",{"_path":77,"title":78},"/docs/outbound/migrate","Migrate to the Outbound Gateway",{"_path":80,"title":81},"/docs/outbound/migrate/svix","Migrate from Svix",{"_path":83,"title":84},"/docs/outbound/migrate/hookdeck-outpost","Migrate from Hookdeck Outpost",{"_path":86,"title":87},"/docs/outbound/migrate/convoy","Migrate from Convoy",{"_path":89,"title":90},"/docs/outbound/migrate/hook0","Migrate from Hook0",{"_path":92,"title":93},"/docs/outbound/migrate/diy","Migrate a homegrown webhook sender",{"_path":95,"title":96},"/docs/security","Security & Tech",{"_path":98,"title":99},"/docs/service-connections","Service Connections",{"_path":101,"title":102},"/docs/service-connections/ai-providers","AI provider connections",{"_path":104,"title":105},"/docs/service-connections/aws_s3","AWS S3",{"_path":107,"title":108},"/docs/service-connections/aws_sns","AWS SNS",{"_path":110,"title":111},"/docs/service-connections/aws_sqs","AWS SQS",{"_path":113,"title":114},"/docs/service-connections/azure","Azure",{"_path":116,"title":117},"/docs/service-connections/gcp_gcs","GCP Cloud Storage",{"_path":119,"title":120},"/docs/service-connections/gcp_pubsub","GCP Pub/Sub",{"_path":122,"title":123},"/docs/service-connections/secrets","Secrets",{"_path":125,"title":126},"/docs/skills","Agent Skills",{"_path":128,"title":129},"/docs/skills-cli","skills.sh — the Agent Skills CLI",{"_path":131,"title":132},"/docs/tunnels/demoing-your-website","Demoing your website",{"_path":134,"title":135},"/docs/tunnels/regions","Regions",{"_path":137,"title":138},"/docs/tutorials/cicd/jenkins-bitbucket","Jenkins and Bitbucket",{"_path":140,"title":141},"/docs/tutorials/cicd/jenkins-github","Jenkins and GitHub",{"_path":143,"title":144},"/docs/tutorials/cicd/jenkins-plugin","Jenkins Plugin",{"_path":146,"title":147},"/docs/tutorials/cicd/jenkins-plugin-multibranch","Jenkins Multibranch Pipelines",{"_path":149,"title":150},"/docs/tutorials/cicd/kubernetes-operator","Kubernetes Operator",{"_path":152,"title":153},"/docs/tutorials/cicd/terraform-atlantis","Terraform Atlantis",{"_path":155,"title":156},"/docs/tutorials/cicd/webhook-exec","Execute scripts on webhook",{"_path":158,"title":159},"/docs/tutorials/edge/home-assistant","Home Assistant",{"_path":161,"title":162},"/docs/tutorials/edge/javascript-app","JavaScript app",{"_path":164,"title":165},"/docs/tutorials/edge/node-red","Node-RED",{"_path":167,"title":168},"/docs/tutorials/email/airtable","Email to Airtable",{"_path":170,"title":171},"/docs/tutorials/email/api","Email to API",{"_path":173,"title":174},"/docs/tutorials/email/database","Email to Database",{"_path":176,"title":177},"/docs/tutorials/email/discord","Email to Discord",{"_path":179,"title":180},"/docs/tutorials/email/google-sheets","Email to Google Sheets",{"_path":182,"title":183},"/docs/tutorials/email/microsoft-teams","Email to Microsoft Teams",{"_path":185,"title":186},"/docs/tutorials/email/notion","Email to Notion",{"_path":188,"title":189},"/docs/tutorials/email/slack","Email to Slack",{"_path":191,"title":192},"/docs/tutorials","Tutorials",{"_path":194,"title":195},"/docs/tutorials/n8n/email-trigger","n8n Email Trigger (Inbound Email)",{"_path":197,"title":198},"/docs/tutorials/n8n/webhook-trigger","n8n Webhook Trigger (No Public IP)",{"_path":200,"title":201},"/docs/tutorials/n8n/whatsapp-cloud-api-webhook","n8n WhatsApp Cloud API Webhook Setup",{"_path":203,"title":204},"/docs/tutorials/outbound/send-webhooks-nodejs","Send webhooks to your customers from a Node.js / TypeScript app",{"_path":206,"title":207},"/docs/tutorials/outbound/send-webhooks-go","Send webhooks to your customers from a Go service",{"_path":209,"title":210},"/docs/tutorials/outbound/nextjs-saas-webhooks","Add webhooks to a Next.js SaaS app",{"_path":212,"title":213},"/docs/tutorials/transform/docker-to-slack","DockerHub webhook to Slack notification",{"_path":215,"title":216},"/docs/tutorials/transform/enrich-webhooks","Enrich webhooks from APIs",{"_path":218,"title":219},"/docs/tutorials/transform/stripe-to-plain","Sync Stripe subscriptions to Plain.com tenants",{"_path":221,"title":222},"/docs/tutorials/warehouse/bigquery","GCP BigQuery",{"_path":224,"title":225},"/docs/webhooks/alerts","Alerts",{"_path":227,"title":228},"/docs/webhooks/auth/username-password","Username and password",{"_path":230,"title":231},"/docs/webhooks/auth/hmac","HMAC",{"_path":233,"title":234},"/docs/webhooks/auth/jwt","JWT authentication",{"_path":236,"title":237},"/docs/webhooks/auth/http-method","Auth using request method",{"_path":239,"title":240},"/docs/webhooks/cors","CORS for webhooks",{"_path":242,"title":243},"/docs/webhooks/cron/using-cron-webhooks","Schedule recurring webhooks",{"_path":245,"title":246},"/docs/webhooks/custom-domains","Custom webhook domains",{"_path":248,"title":249},"/docs/webhooks/custom-subdomains","Custom webhook subdomains",{"_path":251,"title":252},"/docs/webhooks/custom-webhook-response","Custom response to webhooks",{"_path":254,"title":255},"/docs/webhooks/durable-webhooks","Durable webhooks: reliable delivery with automatic retries",{"_path":257,"title":258},"/docs/webhooks/functions/manipulating-json","JSON encoding",{"_path":260,"title":261},"/docs/webhooks/functions/make-http-request","Make HTTP request",{"_path":263,"title":264},"/docs/webhooks/functions/modify-request","Modify webhook headers, body, method and path",{"_path":266,"title":267},"/docs/webhooks/functions/multipart-form-data","Multipart form to JSON",{"_path":269,"title":270},"/docs/webhooks/functions/url-encoded-data","URL Encoded Form",{"_path":272,"title":273},"/docs/webhooks/functions/working-with-time","Working with time",{"_path":275,"title":276},"/docs/webhooks/functions/send-emails","Sending emails",{"_path":278,"title":279},"/docs/webhooks/functions/crypto-functions","Base64, encryption",{"_path":281,"title":282},"/docs/webhooks/functions/integrate-into-cicd","Integrating into CI/CD",{"_path":284,"title":222},"/docs/webhooks/functions/big-query",{"_path":286,"title":287},"/docs/webhooks/functions/accessing-metadata","Accessing metadata",{"_path":289,"title":290},"/docs/webhooks/functions/response-functions","Response (post-delivery) functions",{"_path":292,"title":293},"/docs/webhooks/functions/alerting","Alerting from functions",{"_path":295,"title":296},"/docs/webhooks/functions/helper-libraries","Helper libraries",{"_path":298,"title":299},"/docs/webhooks/functions/transform-webhook-payload","Transform a webhook payload",{"_path":301,"title":302},"/docs/webhooks/functions/filter-webhooks","Filter or drop webhooks before forwarding",{"_path":304,"title":305},"/docs/webhooks/functions/provider-helpers","Provider-aware function helpers",{"_path":307,"title":308},"/docs/webhooks/functions","Webhook transformations (functions): modify body, headers, method and path",{"_path":310,"title":311},"/docs/webhooks/internal/localhost","Receive webhooks on localhost with the relay CLI",{"_path":313,"title":314},"/docs/webhooks/large-webhooks","Large Webhooks",{"_path":316,"title":317},"/docs/webhooks/outbound-throttling","Outbound throttling: control webhook delivery speed",{"_path":319,"title":320},"/docs/webhooks/polling-webhooks","Polling webhooks with /v1/events",{"_path":322,"title":323},"/docs/webhooks/public/public-destination","Forward to public URL",{"_path":325,"title":326},"/docs/webhooks/public/multiple-destination-urls","Forward webhooks to multiple destinations",{"_path":328,"title":329},"/docs/webhooks/replay-on-agent-connect","Webhook replay on agent connect: recover missed webhooks",{"_path":331,"title":332},"/docs/webhooks/static-ip-address","Static IP Address",{"_path":334,"title":335},"/docs/webhooks/tls-ssl-errors","Fix TLS/SSL handshake errors: unsupported protocol, wrong version number, handshake failure",{"_path":337,"title":338},"/docs/webhooks/websocket-server","Connecting to websocket server",{"_path":340,"title":341},"/docs/webhooks/zero-retention-buckets","Zero Retention Buckets",{"_path":209,"_dir":343,"_draft":344,"_partial":344,"_locale":345,"title":210,"description":346,"intro":347,"type":348,"layout":349,"tags":350,"faq":356,"body":369,"_type":6564,"_id":6565,"_source":6566,"_file":6567,"_stem":6568,"_extension":6569,"sitemap":6570},"outbound",false,"","Let customers register webhook endpoints from your Next.js settings page, publish events from route handlers and show delivery history, with Webhook Relay's Outbound Gateway and @webhookrelay/sdk. App Router, server actions, complete code.","Give your Next.js SaaS a customer-facing webhooks settings page in an afternoon: customers add endpoints and copy their signing secret, your server code publishes events, and Webhook Relay delivers, retries and logs them.","tutorial","doc",[351,352,353,354,355],"Outbound webhooks","Next.js","Send webhooks","SaaS","TypeScript",[357,360,363,366],{"q":358,"a":359},"Can I call the Webhook Relay SDK from a Next.js client component?","No. The access token must stay on the server. Call the SDK only from server components, server actions and route handlers, and import the client module from a file marked server-only so a build fails if it is ever bundled for the browser.",{"q":361,"a":362},"How do I stop one customer from editing another customer's webhook endpoints?","Use your organization ID as the Webhook Relay consumer ID, and before every update, delete, retry or secret operation fetch the endpoint and check that its consumer field equals the signed-in user's organization ID. Never trust an endpoint ID from a form on its own.",{"q":364,"a":365},"Does Webhook Relay provide an embeddable webhook portal for my customers?","Not yet. You build the settings page yourself with the SDK, as in this tutorial, which keeps it in your own design system and auth. Everything a portal needs is in the API: event types, endpoints, secrets, delivery history, retry and health.",{"q":367,"a":368},"What should happen when a customer's endpoint keeps failing?","Webhook Relay marks the endpoint failing after 5 failed attempts in a row and keeps retrying each delivery for up to 48 hours. Show the endpoint state and recent failures on the settings page, let the customer retry or re-send failed deliveries after they fix their server, and enable auto-disable so an endpoint that fails 100 times in a row over at least 12 hours stops receiving traffic.",{"type":370,"children":371,"toc":6554},"root",[372,406,411,494,501,563,597,650,695,701,713,1638,1764,1770,1775,3311,3317,3322,4223,4229,4234,5857,5884,5890,5895,6441,6466,6472,6491,6497,6548],{"type":373,"tag":374,"props":375,"children":376},"element","p",{},[377,393,395,404],{"type":373,"tag":378,"props":379,"children":380},"strong",{},[381,384,391],{"type":382,"value":383},"text","To add webhooks to a Next.js SaaS app, use Webhook Relay's Outbound Gateway as the delivery backend: a settings page lets each customer register HTTPS endpoints through a server action, your route handlers call ",{"type":373,"tag":385,"props":386,"children":388},"code",{"className":387},[],[389],{"type":382,"value":390},"relay.outbound.messages.publish()",{"type":382,"value":392}," when something happens, and the same page reads delivery history back from the API.",{"type":382,"value":394}," Webhook Relay signs every delivery with ",{"type":373,"tag":396,"props":397,"children":401},"a",{"href":398,"rel":399},"https://www.standardwebhooks.com/",[400],"nofollow",[402],{"type":382,"value":403},"Standard Webhooks",{"type":382,"value":405}," headers, retries failures up to eight times within 48 hours, paces each endpoint separately and keeps 35 days of attempts. Your app stores nothing but an organization ID.",{"type":373,"tag":374,"props":407,"children":408},{},[409],{"type":382,"value":410},"What you'll build (App Router, React 19 / Next.js 15):",{"type":373,"tag":412,"props":413,"children":416},"pre",{"className":414,"code":415,"language":382,"meta":345,"style":345},"language-text shiki shiki-themes github-dark","app/\n  settings/webhooks/page.tsx        endpoints, state, recent deliveries\n  settings/webhooks/actions.ts      add / delete / retry / rotate (server actions)\n  settings/webhooks/add-endpoint.tsx  form that shows the signing secret once\n  api/invoices/[id]/pay/route.ts    business logic that publishes invoice.paid\nlib/\n  webhooks.ts                       server-only Webhook Relay client + ownership checks\n  auth.ts                           your existing auth (stubbed here)\n",[417],{"type":373,"tag":385,"props":418,"children":419},{"__ignoreMap":345},[420,431,440,449,458,467,476,485],{"type":373,"tag":421,"props":422,"children":425},"span",{"class":423,"line":424},"line",1,[426],{"type":373,"tag":421,"props":427,"children":428},{},[429],{"type":382,"value":430},"app/\n",{"type":373,"tag":421,"props":432,"children":434},{"class":423,"line":433},2,[435],{"type":373,"tag":421,"props":436,"children":437},{},[438],{"type":382,"value":439},"  settings/webhooks/page.tsx        endpoints, state, recent deliveries\n",{"type":373,"tag":421,"props":441,"children":443},{"class":423,"line":442},3,[444],{"type":373,"tag":421,"props":445,"children":446},{},[447],{"type":382,"value":448},"  settings/webhooks/actions.ts      add / delete / retry / rotate (server actions)\n",{"type":373,"tag":421,"props":450,"children":452},{"class":423,"line":451},4,[453],{"type":373,"tag":421,"props":454,"children":455},{},[456],{"type":382,"value":457},"  settings/webhooks/add-endpoint.tsx  form that shows the signing secret once\n",{"type":373,"tag":421,"props":459,"children":461},{"class":423,"line":460},5,[462],{"type":373,"tag":421,"props":463,"children":464},{},[465],{"type":382,"value":466},"  api/invoices/[id]/pay/route.ts    business logic that publishes invoice.paid\n",{"type":373,"tag":421,"props":468,"children":470},{"class":423,"line":469},6,[471],{"type":373,"tag":421,"props":472,"children":473},{},[474],{"type":382,"value":475},"lib/\n",{"type":373,"tag":421,"props":477,"children":479},{"class":423,"line":478},7,[480],{"type":373,"tag":421,"props":481,"children":482},{},[483],{"type":382,"value":484},"  webhooks.ts                       server-only Webhook Relay client + ownership checks\n",{"type":373,"tag":421,"props":486,"children":488},{"class":423,"line":487},8,[489],{"type":373,"tag":421,"props":490,"children":491},{},[492],{"type":382,"value":493},"  auth.ts                           your existing auth (stubbed here)\n",{"type":373,"tag":495,"props":496,"children":498},"h2",{"id":497},"prerequisites",[499],{"type":382,"value":500},"Prerequisites",{"type":373,"tag":502,"props":503,"children":504},"ul",{},[505,516,558],{"type":373,"tag":506,"props":507,"children":508},"li",{},[509,514],{"type":373,"tag":378,"props":510,"children":511},{},[512],{"type":382,"value":513},"A Webhook Relay account on the Basic plan or above",{"type":382,"value":515}," ($9.99/month covers 100 customers with up to 10 endpoints each; the Outbound Gateway is not on the Free plan).",{"type":373,"tag":506,"props":517,"children":518},{},[519,524,526,533,535,541,543,548,550,556],{"type":373,"tag":378,"props":520,"children":521},{},[522],{"type":382,"value":523},"An access token restricted to Outbound: manage",{"type":382,"value":525}," from the ",{"type":373,"tag":396,"props":527,"children":530},{"href":528,"rel":529},"https://my.webhookrelay.com/tokens",[400],[531],{"type":382,"value":532},"Access Tokens",{"type":382,"value":534}," page. The settings page creates endpoints, so it needs ",{"type":373,"tag":385,"props":536,"children":538},{"className":537},[],[539],{"type":382,"value":540},"manage",{"type":382,"value":542},". If events are published by a separate worker, give that worker its own ",{"type":373,"tag":378,"props":544,"children":545},{},[546],{"type":382,"value":547},"Outbound: publish only",{"type":382,"value":549}," token (",{"type":373,"tag":385,"props":551,"children":553},{"className":552},[],[554],{"type":382,"value":555},"\"permissions\": { \"outbound\": \"publish\" }",{"type":382,"value":557},").",{"type":373,"tag":506,"props":559,"children":560},{},[561],{"type":382,"value":562},"A Next.js 15 app using the App Router.",{"type":373,"tag":412,"props":564,"children":568},{"className":565,"code":566,"language":567,"meta":345,"style":345},"language-bash shiki shiki-themes github-dark","npm install @webhookrelay/sdk server-only\n","bash",[569],{"type":373,"tag":385,"props":570,"children":571},{"__ignoreMap":345},[572],{"type":373,"tag":421,"props":573,"children":574},{"class":423,"line":424},[575,581,587,592],{"type":373,"tag":421,"props":576,"children":578},{"style":577},"--shiki-default:#B392F0",[579],{"type":382,"value":580},"npm",{"type":373,"tag":421,"props":582,"children":584},{"style":583},"--shiki-default:#9ECBFF",[585],{"type":382,"value":586}," install",{"type":373,"tag":421,"props":588,"children":589},{"style":583},[590],{"type":382,"value":591}," @webhookrelay/sdk",{"type":373,"tag":421,"props":593,"children":594},{"style":583},[595],{"type":382,"value":596}," server-only\n",{"type":373,"tag":412,"props":598,"children":600},{"className":565,"code":599,"language":567,"meta":345,"style":345},"# .env.local\nRELAY_KEY=YOUR_TOKEN_KEY\nRELAY_SECRET=YOUR_TOKEN_SECRET\n",[601],{"type":373,"tag":385,"props":602,"children":603},{"__ignoreMap":345},[604,613,633],{"type":373,"tag":421,"props":605,"children":606},{"class":423,"line":424},[607],{"type":373,"tag":421,"props":608,"children":610},{"style":609},"--shiki-default:#6A737D",[611],{"type":382,"value":612},"# .env.local\n",{"type":373,"tag":421,"props":614,"children":615},{"class":423,"line":433},[616,622,628],{"type":373,"tag":421,"props":617,"children":619},{"style":618},"--shiki-default:#E1E4E8",[620],{"type":382,"value":621},"RELAY_KEY",{"type":373,"tag":421,"props":623,"children":625},{"style":624},"--shiki-default:#F97583",[626],{"type":382,"value":627},"=",{"type":373,"tag":421,"props":629,"children":630},{"style":583},[631],{"type":382,"value":632},"YOUR_TOKEN_KEY\n",{"type":373,"tag":421,"props":634,"children":635},{"class":423,"line":442},[636,641,645],{"type":373,"tag":421,"props":637,"children":638},{"style":618},[639],{"type":382,"value":640},"RELAY_SECRET",{"type":373,"tag":421,"props":642,"children":643},{"style":624},[644],{"type":382,"value":627},{"type":373,"tag":421,"props":646,"children":647},{"style":583},[648],{"type":382,"value":649},"YOUR_TOKEN_SECRET\n",{"type":373,"tag":374,"props":651,"children":652},{},[653,655,662,664,669,671,677,679,685,687,693],{"type":382,"value":654},"Create your event catalog once, from a script or the ",{"type":373,"tag":396,"props":656,"children":659},{"href":657,"rel":658},"https://my.webhookrelay.com/outbound",[400],[660],{"type":382,"value":661},"dashboard",{"type":382,"value":663},". See step 2 of the ",{"type":373,"tag":396,"props":665,"children":666},{"href":203},[667],{"type":382,"value":668},"Node.js tutorial",{"type":382,"value":670}," for the ",{"type":373,"tag":385,"props":672,"children":674},{"className":673},[],[675],{"type":382,"value":676},"eventTypes.upsert",{"type":382,"value":678}," calls; this tutorial assumes ",{"type":373,"tag":385,"props":680,"children":682},{"className":681},[],[683],{"type":382,"value":684},"invoice.paid",{"type":382,"value":686}," and ",{"type":373,"tag":385,"props":688,"children":690},{"className":689},[],[691],{"type":382,"value":692},"invoice.refunded",{"type":382,"value":694}," exist.",{"type":373,"tag":495,"props":696,"children":698},{"id":697},"_1-a-server-only-client-with-ownership-checks",[699],{"type":382,"value":700},"1. A server-only client with ownership checks",{"type":373,"tag":374,"props":702,"children":703},{},[704,706,711],{"type":382,"value":705},"Every customer organization is one Webhook Relay ",{"type":373,"tag":378,"props":707,"children":708},{},[709],{"type":382,"value":710},"consumer",{"type":382,"value":712},", keyed by your own org ID. The helper that loads an endpoint also checks it belongs to the caller's org: that check is what keeps one tenant from touching another tenant's endpoints.",{"type":373,"tag":412,"props":714,"children":718},{"className":715,"code":716,"language":717,"meta":345,"style":345},"language-ts shiki shiki-themes github-dark","// lib/webhooks.ts\nimport \"server-only\";\nimport { WebhookRelay, WebhookRelayAPIError } from \"@webhookrelay/sdk\";\n\nexport const relay = new WebhookRelay({\n  key: process.env.RELAY_KEY,\n  secret: process.env.RELAY_SECRET,\n});\n\n/** Ensure the org exists as a consumer. Safe to call repeatedly. */\nexport async function ensureConsumer(org: { id: string; name: string }) {\n  await relay.outbound.consumers.upsert(org.id, { name: org.name });\n}\n\n/** Load an endpoint only if it belongs to this org. */\nexport async function getOwnedEndpoint(orgId: string, endpointId: string) {\n  const endpoint = await relay.outbound.endpoints.get(endpointId);\n  if (endpoint.consumer !== orgId) throw new Error(\"endpoint not found\");\n  return endpoint;\n}\n\n/** An org's endpoints; an org that never added one has no consumer yet. */\nexport async function listEndpoints(orgId: string) {\n  try {\n    return await relay.outbound.endpoints.list(orgId);\n  } catch (err) {\n    if (err instanceof WebhookRelayAPIError && err.status === 404) return [];\n    throw err;\n  }\n}\n\n/** Publish an event for one org. Returns null if the org has no consumer. */\nexport async function publishEvent(orgId: string, eventType: string, payload: unknown, idempotencyKey: string) {\n  try {\n    return await relay.outbound.messages.publish({ consumer: orgId, eventType, payload }, { idempotencyKey });\n  } catch (err) {\n    if (err instanceof WebhookRelayAPIError && err.status === 404) return null;\n    throw err;\n  }\n}\n","ts",[719],{"type":373,"tag":385,"props":720,"children":721},{"__ignoreMap":345},[722,730,748,774,783,822,839,855,863,871,880,961,985,994,1002,1011,1072,1110,1162,1176,1184,1192,1201,1242,1256,1283,1302,1361,1375,1384,1392,1400,1409,1502,1514,1541,1557,1610,1622,1630],{"type":373,"tag":421,"props":723,"children":724},{"class":423,"line":424},[725],{"type":373,"tag":421,"props":726,"children":727},{"style":609},[728],{"type":382,"value":729},"// lib/webhooks.ts\n",{"type":373,"tag":421,"props":731,"children":732},{"class":423,"line":433},[733,738,743],{"type":373,"tag":421,"props":734,"children":735},{"style":624},[736],{"type":382,"value":737},"import",{"type":373,"tag":421,"props":739,"children":740},{"style":583},[741],{"type":382,"value":742}," \"server-only\"",{"type":373,"tag":421,"props":744,"children":745},{"style":618},[746],{"type":382,"value":747},";\n",{"type":373,"tag":421,"props":749,"children":750},{"class":423,"line":442},[751,755,760,765,770],{"type":373,"tag":421,"props":752,"children":753},{"style":624},[754],{"type":382,"value":737},{"type":373,"tag":421,"props":756,"children":757},{"style":618},[758],{"type":382,"value":759}," { WebhookRelay, WebhookRelayAPIError } ",{"type":373,"tag":421,"props":761,"children":762},{"style":624},[763],{"type":382,"value":764},"from",{"type":373,"tag":421,"props":766,"children":767},{"style":583},[768],{"type":382,"value":769}," \"@webhookrelay/sdk\"",{"type":373,"tag":421,"props":771,"children":772},{"style":618},[773],{"type":382,"value":747},{"type":373,"tag":421,"props":775,"children":776},{"class":423,"line":451},[777],{"type":373,"tag":421,"props":778,"children":780},{"emptyLinePlaceholder":779},true,[781],{"type":382,"value":782},"\n",{"type":373,"tag":421,"props":784,"children":785},{"class":423,"line":460},[786,791,796,802,807,812,817],{"type":373,"tag":421,"props":787,"children":788},{"style":624},[789],{"type":382,"value":790},"export",{"type":373,"tag":421,"props":792,"children":793},{"style":624},[794],{"type":382,"value":795}," const",{"type":373,"tag":421,"props":797,"children":799},{"style":798},"--shiki-default:#79B8FF",[800],{"type":382,"value":801}," relay",{"type":373,"tag":421,"props":803,"children":804},{"style":624},[805],{"type":382,"value":806}," =",{"type":373,"tag":421,"props":808,"children":809},{"style":624},[810],{"type":382,"value":811}," new",{"type":373,"tag":421,"props":813,"children":814},{"style":577},[815],{"type":382,"value":816}," WebhookRelay",{"type":373,"tag":421,"props":818,"children":819},{"style":618},[820],{"type":382,"value":821},"({\n",{"type":373,"tag":421,"props":823,"children":824},{"class":423,"line":469},[825,830,834],{"type":373,"tag":421,"props":826,"children":827},{"style":618},[828],{"type":382,"value":829},"  key: process.env.",{"type":373,"tag":421,"props":831,"children":832},{"style":798},[833],{"type":382,"value":621},{"type":373,"tag":421,"props":835,"children":836},{"style":618},[837],{"type":382,"value":838},",\n",{"type":373,"tag":421,"props":840,"children":841},{"class":423,"line":478},[842,847,851],{"type":373,"tag":421,"props":843,"children":844},{"style":618},[845],{"type":382,"value":846},"  secret: process.env.",{"type":373,"tag":421,"props":848,"children":849},{"style":798},[850],{"type":382,"value":640},{"type":373,"tag":421,"props":852,"children":853},{"style":618},[854],{"type":382,"value":838},{"type":373,"tag":421,"props":856,"children":857},{"class":423,"line":487},[858],{"type":373,"tag":421,"props":859,"children":860},{"style":618},[861],{"type":382,"value":862},"});\n",{"type":373,"tag":421,"props":864,"children":866},{"class":423,"line":865},9,[867],{"type":373,"tag":421,"props":868,"children":869},{"emptyLinePlaceholder":779},[870],{"type":382,"value":782},{"type":373,"tag":421,"props":872,"children":874},{"class":423,"line":873},10,[875],{"type":373,"tag":421,"props":876,"children":877},{"style":609},[878],{"type":382,"value":879},"/** Ensure the org exists as a consumer. Safe to call repeatedly. */\n",{"type":373,"tag":421,"props":881,"children":883},{"class":423,"line":882},11,[884,888,893,898,903,908,914,919,924,929,933,938,943,948,952,956],{"type":373,"tag":421,"props":885,"children":886},{"style":624},[887],{"type":382,"value":790},{"type":373,"tag":421,"props":889,"children":890},{"style":624},[891],{"type":382,"value":892}," async",{"type":373,"tag":421,"props":894,"children":895},{"style":624},[896],{"type":382,"value":897}," function",{"type":373,"tag":421,"props":899,"children":900},{"style":577},[901],{"type":382,"value":902}," ensureConsumer",{"type":373,"tag":421,"props":904,"children":905},{"style":618},[906],{"type":382,"value":907},"(",{"type":373,"tag":421,"props":909,"children":911},{"style":910},"--shiki-default:#FFAB70",[912],{"type":382,"value":913},"org",{"type":373,"tag":421,"props":915,"children":916},{"style":624},[917],{"type":382,"value":918},":",{"type":373,"tag":421,"props":920,"children":921},{"style":618},[922],{"type":382,"value":923}," { ",{"type":373,"tag":421,"props":925,"children":926},{"style":910},[927],{"type":382,"value":928},"id",{"type":373,"tag":421,"props":930,"children":931},{"style":624},[932],{"type":382,"value":918},{"type":373,"tag":421,"props":934,"children":935},{"style":798},[936],{"type":382,"value":937}," string",{"type":373,"tag":421,"props":939,"children":940},{"style":618},[941],{"type":382,"value":942},"; ",{"type":373,"tag":421,"props":944,"children":945},{"style":910},[946],{"type":382,"value":947},"name",{"type":373,"tag":421,"props":949,"children":950},{"style":624},[951],{"type":382,"value":918},{"type":373,"tag":421,"props":953,"children":954},{"style":798},[955],{"type":382,"value":937},{"type":373,"tag":421,"props":957,"children":958},{"style":618},[959],{"type":382,"value":960}," }) {\n",{"type":373,"tag":421,"props":962,"children":964},{"class":423,"line":963},12,[965,970,975,980],{"type":373,"tag":421,"props":966,"children":967},{"style":624},[968],{"type":382,"value":969},"  await",{"type":373,"tag":421,"props":971,"children":972},{"style":618},[973],{"type":382,"value":974}," relay.outbound.consumers.",{"type":373,"tag":421,"props":976,"children":977},{"style":577},[978],{"type":382,"value":979},"upsert",{"type":373,"tag":421,"props":981,"children":982},{"style":618},[983],{"type":382,"value":984},"(org.id, { name: org.name });\n",{"type":373,"tag":421,"props":986,"children":988},{"class":423,"line":987},13,[989],{"type":373,"tag":421,"props":990,"children":991},{"style":618},[992],{"type":382,"value":993},"}\n",{"type":373,"tag":421,"props":995,"children":997},{"class":423,"line":996},14,[998],{"type":373,"tag":421,"props":999,"children":1000},{"emptyLinePlaceholder":779},[1001],{"type":382,"value":782},{"type":373,"tag":421,"props":1003,"children":1005},{"class":423,"line":1004},15,[1006],{"type":373,"tag":421,"props":1007,"children":1008},{"style":609},[1009],{"type":382,"value":1010},"/** Load an endpoint only if it belongs to this org. */\n",{"type":373,"tag":421,"props":1012,"children":1014},{"class":423,"line":1013},16,[1015,1019,1023,1027,1032,1036,1041,1045,1049,1054,1059,1063,1067],{"type":373,"tag":421,"props":1016,"children":1017},{"style":624},[1018],{"type":382,"value":790},{"type":373,"tag":421,"props":1020,"children":1021},{"style":624},[1022],{"type":382,"value":892},{"type":373,"tag":421,"props":1024,"children":1025},{"style":624},[1026],{"type":382,"value":897},{"type":373,"tag":421,"props":1028,"children":1029},{"style":577},[1030],{"type":382,"value":1031}," getOwnedEndpoint",{"type":373,"tag":421,"props":1033,"children":1034},{"style":618},[1035],{"type":382,"value":907},{"type":373,"tag":421,"props":1037,"children":1038},{"style":910},[1039],{"type":382,"value":1040},"orgId",{"type":373,"tag":421,"props":1042,"children":1043},{"style":624},[1044],{"type":382,"value":918},{"type":373,"tag":421,"props":1046,"children":1047},{"style":798},[1048],{"type":382,"value":937},{"type":373,"tag":421,"props":1050,"children":1051},{"style":618},[1052],{"type":382,"value":1053},", ",{"type":373,"tag":421,"props":1055,"children":1056},{"style":910},[1057],{"type":382,"value":1058},"endpointId",{"type":373,"tag":421,"props":1060,"children":1061},{"style":624},[1062],{"type":382,"value":918},{"type":373,"tag":421,"props":1064,"children":1065},{"style":798},[1066],{"type":382,"value":937},{"type":373,"tag":421,"props":1068,"children":1069},{"style":618},[1070],{"type":382,"value":1071},") {\n",{"type":373,"tag":421,"props":1073,"children":1075},{"class":423,"line":1074},17,[1076,1081,1086,1090,1095,1100,1105],{"type":373,"tag":421,"props":1077,"children":1078},{"style":624},[1079],{"type":382,"value":1080},"  const",{"type":373,"tag":421,"props":1082,"children":1083},{"style":798},[1084],{"type":382,"value":1085}," endpoint",{"type":373,"tag":421,"props":1087,"children":1088},{"style":624},[1089],{"type":382,"value":806},{"type":373,"tag":421,"props":1091,"children":1092},{"style":624},[1093],{"type":382,"value":1094}," await",{"type":373,"tag":421,"props":1096,"children":1097},{"style":618},[1098],{"type":382,"value":1099}," relay.outbound.endpoints.",{"type":373,"tag":421,"props":1101,"children":1102},{"style":577},[1103],{"type":382,"value":1104},"get",{"type":373,"tag":421,"props":1106,"children":1107},{"style":618},[1108],{"type":382,"value":1109},"(endpointId);\n",{"type":373,"tag":421,"props":1111,"children":1113},{"class":423,"line":1112},18,[1114,1119,1124,1129,1134,1139,1143,1148,1152,1157],{"type":373,"tag":421,"props":1115,"children":1116},{"style":624},[1117],{"type":382,"value":1118},"  if",{"type":373,"tag":421,"props":1120,"children":1121},{"style":618},[1122],{"type":382,"value":1123}," (endpoint.consumer ",{"type":373,"tag":421,"props":1125,"children":1126},{"style":624},[1127],{"type":382,"value":1128},"!==",{"type":373,"tag":421,"props":1130,"children":1131},{"style":618},[1132],{"type":382,"value":1133}," orgId) ",{"type":373,"tag":421,"props":1135,"children":1136},{"style":624},[1137],{"type":382,"value":1138},"throw",{"type":373,"tag":421,"props":1140,"children":1141},{"style":624},[1142],{"type":382,"value":811},{"type":373,"tag":421,"props":1144,"children":1145},{"style":577},[1146],{"type":382,"value":1147}," Error",{"type":373,"tag":421,"props":1149,"children":1150},{"style":618},[1151],{"type":382,"value":907},{"type":373,"tag":421,"props":1153,"children":1154},{"style":583},[1155],{"type":382,"value":1156},"\"endpoint not found\"",{"type":373,"tag":421,"props":1158,"children":1159},{"style":618},[1160],{"type":382,"value":1161},");\n",{"type":373,"tag":421,"props":1163,"children":1165},{"class":423,"line":1164},19,[1166,1171],{"type":373,"tag":421,"props":1167,"children":1168},{"style":624},[1169],{"type":382,"value":1170},"  return",{"type":373,"tag":421,"props":1172,"children":1173},{"style":618},[1174],{"type":382,"value":1175}," endpoint;\n",{"type":373,"tag":421,"props":1177,"children":1179},{"class":423,"line":1178},20,[1180],{"type":373,"tag":421,"props":1181,"children":1182},{"style":618},[1183],{"type":382,"value":993},{"type":373,"tag":421,"props":1185,"children":1187},{"class":423,"line":1186},21,[1188],{"type":373,"tag":421,"props":1189,"children":1190},{"emptyLinePlaceholder":779},[1191],{"type":382,"value":782},{"type":373,"tag":421,"props":1193,"children":1195},{"class":423,"line":1194},22,[1196],{"type":373,"tag":421,"props":1197,"children":1198},{"style":609},[1199],{"type":382,"value":1200},"/** An org's endpoints; an org that never added one has no consumer yet. */\n",{"type":373,"tag":421,"props":1202,"children":1204},{"class":423,"line":1203},23,[1205,1209,1213,1217,1222,1226,1230,1234,1238],{"type":373,"tag":421,"props":1206,"children":1207},{"style":624},[1208],{"type":382,"value":790},{"type":373,"tag":421,"props":1210,"children":1211},{"style":624},[1212],{"type":382,"value":892},{"type":373,"tag":421,"props":1214,"children":1215},{"style":624},[1216],{"type":382,"value":897},{"type":373,"tag":421,"props":1218,"children":1219},{"style":577},[1220],{"type":382,"value":1221}," listEndpoints",{"type":373,"tag":421,"props":1223,"children":1224},{"style":618},[1225],{"type":382,"value":907},{"type":373,"tag":421,"props":1227,"children":1228},{"style":910},[1229],{"type":382,"value":1040},{"type":373,"tag":421,"props":1231,"children":1232},{"style":624},[1233],{"type":382,"value":918},{"type":373,"tag":421,"props":1235,"children":1236},{"style":798},[1237],{"type":382,"value":937},{"type":373,"tag":421,"props":1239,"children":1240},{"style":618},[1241],{"type":382,"value":1071},{"type":373,"tag":421,"props":1243,"children":1245},{"class":423,"line":1244},24,[1246,1251],{"type":373,"tag":421,"props":1247,"children":1248},{"style":624},[1249],{"type":382,"value":1250},"  try",{"type":373,"tag":421,"props":1252,"children":1253},{"style":618},[1254],{"type":382,"value":1255}," {\n",{"type":373,"tag":421,"props":1257,"children":1259},{"class":423,"line":1258},25,[1260,1265,1269,1273,1278],{"type":373,"tag":421,"props":1261,"children":1262},{"style":624},[1263],{"type":382,"value":1264},"    return",{"type":373,"tag":421,"props":1266,"children":1267},{"style":624},[1268],{"type":382,"value":1094},{"type":373,"tag":421,"props":1270,"children":1271},{"style":618},[1272],{"type":382,"value":1099},{"type":373,"tag":421,"props":1274,"children":1275},{"style":577},[1276],{"type":382,"value":1277},"list",{"type":373,"tag":421,"props":1279,"children":1280},{"style":618},[1281],{"type":382,"value":1282},"(orgId);\n",{"type":373,"tag":421,"props":1284,"children":1286},{"class":423,"line":1285},26,[1287,1292,1297],{"type":373,"tag":421,"props":1288,"children":1289},{"style":618},[1290],{"type":382,"value":1291},"  } ",{"type":373,"tag":421,"props":1293,"children":1294},{"style":624},[1295],{"type":382,"value":1296},"catch",{"type":373,"tag":421,"props":1298,"children":1299},{"style":618},[1300],{"type":382,"value":1301}," (err) {\n",{"type":373,"tag":421,"props":1303,"children":1305},{"class":423,"line":1304},27,[1306,1311,1316,1321,1326,1331,1336,1341,1346,1351,1356],{"type":373,"tag":421,"props":1307,"children":1308},{"style":624},[1309],{"type":382,"value":1310},"    if",{"type":373,"tag":421,"props":1312,"children":1313},{"style":618},[1314],{"type":382,"value":1315}," (err ",{"type":373,"tag":421,"props":1317,"children":1318},{"style":624},[1319],{"type":382,"value":1320},"instanceof",{"type":373,"tag":421,"props":1322,"children":1323},{"style":577},[1324],{"type":382,"value":1325}," WebhookRelayAPIError",{"type":373,"tag":421,"props":1327,"children":1328},{"style":624},[1329],{"type":382,"value":1330}," &&",{"type":373,"tag":421,"props":1332,"children":1333},{"style":618},[1334],{"type":382,"value":1335}," err.status ",{"type":373,"tag":421,"props":1337,"children":1338},{"style":624},[1339],{"type":382,"value":1340},"===",{"type":373,"tag":421,"props":1342,"children":1343},{"style":798},[1344],{"type":382,"value":1345}," 404",{"type":373,"tag":421,"props":1347,"children":1348},{"style":618},[1349],{"type":382,"value":1350},") ",{"type":373,"tag":421,"props":1352,"children":1353},{"style":624},[1354],{"type":382,"value":1355},"return",{"type":373,"tag":421,"props":1357,"children":1358},{"style":618},[1359],{"type":382,"value":1360}," [];\n",{"type":373,"tag":421,"props":1362,"children":1364},{"class":423,"line":1363},28,[1365,1370],{"type":373,"tag":421,"props":1366,"children":1367},{"style":624},[1368],{"type":382,"value":1369},"    throw",{"type":373,"tag":421,"props":1371,"children":1372},{"style":618},[1373],{"type":382,"value":1374}," err;\n",{"type":373,"tag":421,"props":1376,"children":1378},{"class":423,"line":1377},29,[1379],{"type":373,"tag":421,"props":1380,"children":1381},{"style":618},[1382],{"type":382,"value":1383},"  }\n",{"type":373,"tag":421,"props":1385,"children":1387},{"class":423,"line":1386},30,[1388],{"type":373,"tag":421,"props":1389,"children":1390},{"style":618},[1391],{"type":382,"value":993},{"type":373,"tag":421,"props":1393,"children":1395},{"class":423,"line":1394},31,[1396],{"type":373,"tag":421,"props":1397,"children":1398},{"emptyLinePlaceholder":779},[1399],{"type":382,"value":782},{"type":373,"tag":421,"props":1401,"children":1403},{"class":423,"line":1402},32,[1404],{"type":373,"tag":421,"props":1405,"children":1406},{"style":609},[1407],{"type":382,"value":1408},"/** Publish an event for one org. Returns null if the org has no consumer. */\n",{"type":373,"tag":421,"props":1410,"children":1412},{"class":423,"line":1411},33,[1413,1417,1421,1425,1430,1434,1438,1442,1446,1450,1455,1459,1463,1467,1472,1476,1481,1485,1490,1494,1498],{"type":373,"tag":421,"props":1414,"children":1415},{"style":624},[1416],{"type":382,"value":790},{"type":373,"tag":421,"props":1418,"children":1419},{"style":624},[1420],{"type":382,"value":892},{"type":373,"tag":421,"props":1422,"children":1423},{"style":624},[1424],{"type":382,"value":897},{"type":373,"tag":421,"props":1426,"children":1427},{"style":577},[1428],{"type":382,"value":1429}," publishEvent",{"type":373,"tag":421,"props":1431,"children":1432},{"style":618},[1433],{"type":382,"value":907},{"type":373,"tag":421,"props":1435,"children":1436},{"style":910},[1437],{"type":382,"value":1040},{"type":373,"tag":421,"props":1439,"children":1440},{"style":624},[1441],{"type":382,"value":918},{"type":373,"tag":421,"props":1443,"children":1444},{"style":798},[1445],{"type":382,"value":937},{"type":373,"tag":421,"props":1447,"children":1448},{"style":618},[1449],{"type":382,"value":1053},{"type":373,"tag":421,"props":1451,"children":1452},{"style":910},[1453],{"type":382,"value":1454},"eventType",{"type":373,"tag":421,"props":1456,"children":1457},{"style":624},[1458],{"type":382,"value":918},{"type":373,"tag":421,"props":1460,"children":1461},{"style":798},[1462],{"type":382,"value":937},{"type":373,"tag":421,"props":1464,"children":1465},{"style":618},[1466],{"type":382,"value":1053},{"type":373,"tag":421,"props":1468,"children":1469},{"style":910},[1470],{"type":382,"value":1471},"payload",{"type":373,"tag":421,"props":1473,"children":1474},{"style":624},[1475],{"type":382,"value":918},{"type":373,"tag":421,"props":1477,"children":1478},{"style":798},[1479],{"type":382,"value":1480}," unknown",{"type":373,"tag":421,"props":1482,"children":1483},{"style":618},[1484],{"type":382,"value":1053},{"type":373,"tag":421,"props":1486,"children":1487},{"style":910},[1488],{"type":382,"value":1489},"idempotencyKey",{"type":373,"tag":421,"props":1491,"children":1492},{"style":624},[1493],{"type":382,"value":918},{"type":373,"tag":421,"props":1495,"children":1496},{"style":798},[1497],{"type":382,"value":937},{"type":373,"tag":421,"props":1499,"children":1500},{"style":618},[1501],{"type":382,"value":1071},{"type":373,"tag":421,"props":1503,"children":1505},{"class":423,"line":1504},34,[1506,1510],{"type":373,"tag":421,"props":1507,"children":1508},{"style":624},[1509],{"type":382,"value":1250},{"type":373,"tag":421,"props":1511,"children":1512},{"style":618},[1513],{"type":382,"value":1255},{"type":373,"tag":421,"props":1515,"children":1517},{"class":423,"line":1516},35,[1518,1522,1526,1531,1536],{"type":373,"tag":421,"props":1519,"children":1520},{"style":624},[1521],{"type":382,"value":1264},{"type":373,"tag":421,"props":1523,"children":1524},{"style":624},[1525],{"type":382,"value":1094},{"type":373,"tag":421,"props":1527,"children":1528},{"style":618},[1529],{"type":382,"value":1530}," relay.outbound.messages.",{"type":373,"tag":421,"props":1532,"children":1533},{"style":577},[1534],{"type":382,"value":1535},"publish",{"type":373,"tag":421,"props":1537,"children":1538},{"style":618},[1539],{"type":382,"value":1540},"({ consumer: orgId, eventType, payload }, { idempotencyKey });\n",{"type":373,"tag":421,"props":1542,"children":1544},{"class":423,"line":1543},36,[1545,1549,1553],{"type":373,"tag":421,"props":1546,"children":1547},{"style":618},[1548],{"type":382,"value":1291},{"type":373,"tag":421,"props":1550,"children":1551},{"style":624},[1552],{"type":382,"value":1296},{"type":373,"tag":421,"props":1554,"children":1555},{"style":618},[1556],{"type":382,"value":1301},{"type":373,"tag":421,"props":1558,"children":1560},{"class":423,"line":1559},37,[1561,1565,1569,1573,1577,1581,1585,1589,1593,1597,1601,1606],{"type":373,"tag":421,"props":1562,"children":1563},{"style":624},[1564],{"type":382,"value":1310},{"type":373,"tag":421,"props":1566,"children":1567},{"style":618},[1568],{"type":382,"value":1315},{"type":373,"tag":421,"props":1570,"children":1571},{"style":624},[1572],{"type":382,"value":1320},{"type":373,"tag":421,"props":1574,"children":1575},{"style":577},[1576],{"type":382,"value":1325},{"type":373,"tag":421,"props":1578,"children":1579},{"style":624},[1580],{"type":382,"value":1330},{"type":373,"tag":421,"props":1582,"children":1583},{"style":618},[1584],{"type":382,"value":1335},{"type":373,"tag":421,"props":1586,"children":1587},{"style":624},[1588],{"type":382,"value":1340},{"type":373,"tag":421,"props":1590,"children":1591},{"style":798},[1592],{"type":382,"value":1345},{"type":373,"tag":421,"props":1594,"children":1595},{"style":618},[1596],{"type":382,"value":1350},{"type":373,"tag":421,"props":1598,"children":1599},{"style":624},[1600],{"type":382,"value":1355},{"type":373,"tag":421,"props":1602,"children":1603},{"style":798},[1604],{"type":382,"value":1605}," null",{"type":373,"tag":421,"props":1607,"children":1608},{"style":618},[1609],{"type":382,"value":747},{"type":373,"tag":421,"props":1611,"children":1613},{"class":423,"line":1612},38,[1614,1618],{"type":373,"tag":421,"props":1615,"children":1616},{"style":624},[1617],{"type":382,"value":1369},{"type":373,"tag":421,"props":1619,"children":1620},{"style":618},[1621],{"type":382,"value":1374},{"type":373,"tag":421,"props":1623,"children":1625},{"class":423,"line":1624},39,[1626],{"type":373,"tag":421,"props":1627,"children":1628},{"style":618},[1629],{"type":382,"value":1383},{"type":373,"tag":421,"props":1631,"children":1633},{"class":423,"line":1632},40,[1634],{"type":373,"tag":421,"props":1635,"children":1636},{"style":618},[1637],{"type":382,"value":993},{"type":373,"tag":412,"props":1639,"children":1641},{"className":715,"code":1640,"language":717,"meta":345,"style":345},"// lib/auth.ts — replace with your auth (Auth.js, Clerk, WorkOS, Lucia...)\nexport async function getCurrentOrg(): Promise\u003C{ id: string; name: string }> {\n  return { id: \"org_42\", name: \"Acme\" };\n}\n",[1642],{"type":373,"tag":385,"props":1643,"children":1644},{"__ignoreMap":345},[1645,1653,1725,1757],{"type":373,"tag":421,"props":1646,"children":1647},{"class":423,"line":424},[1648],{"type":373,"tag":421,"props":1649,"children":1650},{"style":609},[1651],{"type":382,"value":1652},"// lib/auth.ts — replace with your auth (Auth.js, Clerk, WorkOS, Lucia...)\n",{"type":373,"tag":421,"props":1654,"children":1655},{"class":423,"line":433},[1656,1660,1664,1668,1673,1678,1682,1687,1692,1696,1700,1704,1708,1712,1716,1720],{"type":373,"tag":421,"props":1657,"children":1658},{"style":624},[1659],{"type":382,"value":790},{"type":373,"tag":421,"props":1661,"children":1662},{"style":624},[1663],{"type":382,"value":892},{"type":373,"tag":421,"props":1665,"children":1666},{"style":624},[1667],{"type":382,"value":897},{"type":373,"tag":421,"props":1669,"children":1670},{"style":577},[1671],{"type":382,"value":1672}," getCurrentOrg",{"type":373,"tag":421,"props":1674,"children":1675},{"style":618},[1676],{"type":382,"value":1677},"()",{"type":373,"tag":421,"props":1679,"children":1680},{"style":624},[1681],{"type":382,"value":918},{"type":373,"tag":421,"props":1683,"children":1684},{"style":577},[1685],{"type":382,"value":1686}," Promise",{"type":373,"tag":421,"props":1688,"children":1689},{"style":618},[1690],{"type":382,"value":1691},"\u003C{ ",{"type":373,"tag":421,"props":1693,"children":1694},{"style":910},[1695],{"type":382,"value":928},{"type":373,"tag":421,"props":1697,"children":1698},{"style":624},[1699],{"type":382,"value":918},{"type":373,"tag":421,"props":1701,"children":1702},{"style":798},[1703],{"type":382,"value":937},{"type":373,"tag":421,"props":1705,"children":1706},{"style":618},[1707],{"type":382,"value":942},{"type":373,"tag":421,"props":1709,"children":1710},{"style":910},[1711],{"type":382,"value":947},{"type":373,"tag":421,"props":1713,"children":1714},{"style":624},[1715],{"type":382,"value":918},{"type":373,"tag":421,"props":1717,"children":1718},{"style":798},[1719],{"type":382,"value":937},{"type":373,"tag":421,"props":1721,"children":1722},{"style":618},[1723],{"type":382,"value":1724}," }> {\n",{"type":373,"tag":421,"props":1726,"children":1727},{"class":423,"line":442},[1728,1732,1737,1742,1747,1752],{"type":373,"tag":421,"props":1729,"children":1730},{"style":624},[1731],{"type":382,"value":1170},{"type":373,"tag":421,"props":1733,"children":1734},{"style":618},[1735],{"type":382,"value":1736}," { id: ",{"type":373,"tag":421,"props":1738,"children":1739},{"style":583},[1740],{"type":382,"value":1741},"\"org_42\"",{"type":373,"tag":421,"props":1743,"children":1744},{"style":618},[1745],{"type":382,"value":1746},", name: ",{"type":373,"tag":421,"props":1748,"children":1749},{"style":583},[1750],{"type":382,"value":1751},"\"Acme\"",{"type":373,"tag":421,"props":1753,"children":1754},{"style":618},[1755],{"type":382,"value":1756}," };\n",{"type":373,"tag":421,"props":1758,"children":1759},{"class":423,"line":451},[1760],{"type":373,"tag":421,"props":1761,"children":1762},{"style":618},[1763],{"type":382,"value":993},{"type":373,"tag":495,"props":1765,"children":1767},{"id":1766},"_2-server-actions-for-the-settings-page",[1768],{"type":382,"value":1769},"2. Server actions for the settings page",{"type":373,"tag":374,"props":1771,"children":1772},{},[1773],{"type":382,"value":1774},"Server actions run on the server, so the token never reaches the browser. Each one resolves the org from the session, never from the form.",{"type":373,"tag":412,"props":1776,"children":1778},{"className":715,"code":1777,"language":717,"meta":345,"style":345},"// app/settings/webhooks/actions.ts\n\"use server\";\n\nimport { revalidatePath } from \"next/cache\";\nimport { getCurrentOrg } from \"@/lib/auth\";\nimport { ensureConsumer, getOwnedEndpoint, relay } from \"@/lib/webhooks\";\n\nexport type AddEndpointState = { error?: string; secret?: string };\n\nexport async function addEndpoint(_prev: AddEndpointState, form: FormData): Promise\u003CAddEndpointState> {\n  const org = await getCurrentOrg();\n  const url = String(form.get(\"url\") ?? \"\").trim();\n  const eventTypes = form.getAll(\"eventTypes\").map(String);\n\n  if (!url.startsWith(\"https://\")) return { error: \"The URL must start with https://\" };\n  if (eventTypes.length === 0) return { error: \"Pick at least one event\" };\n\n  try {\n    await ensureConsumer(org);\n    const endpoint = await relay.outbound.endpoints.create(org.id, {\n      url,\n      eventTypes,\n      autoDisable: true,\n    });\n    revalidatePath(\"/settings/webhooks\");\n    // Shown once. The customer verifies signatures with it.\n    return { secret: endpoint.secret };\n  } catch (err) {\n    // Private/loopback hosts, duplicate URLs and plan limits are rejected here.\n    return { error: err instanceof Error ? err.message : \"Could not add the endpoint\" };\n  }\n}\n\nexport async function deleteEndpoint(form: FormData) {\n  const org = await getCurrentOrg();\n  const endpoint = await getOwnedEndpoint(org.id, String(form.get(\"endpointId\")));\n  await relay.outbound.endpoints.delete(endpoint.id);\n  revalidatePath(\"/settings/webhooks\");\n}\n\nexport async function retryDelivery(form: FormData) {\n  const org = await getCurrentOrg();\n  const endpoint = await getOwnedEndpoint(org.id, String(form.get(\"endpointId\")));\n  await relay.outbound.endpoints.retry(endpoint.id, String(form.get(\"messageId\")));\n  revalidatePath(\"/settings/webhooks\");\n}\n\nexport async function resendFailed(form: FormData) {\n  const org = await getCurrentOrg();\n  const endpoint = await getOwnedEndpoint(org.id, String(form.get(\"endpointId\")));\n  // Re-send everything that exhausted its retries in the last 24 hours.\n  await relay.outbound.endpoints.recover(endpoint.id);\n  revalidatePath(\"/settings/webhooks\");\n}\n\nexport async function rotateSecret(_prev: AddEndpointState, form: FormData): Promise\u003CAddEndpointState> {\n  const org = await getCurrentOrg();\n  const endpoint = await getOwnedEndpoint(org.id, String(form.get(\"endpointId\")));\n  // The old secret keeps signing for 24 hours, so the customer can switch without downtime.\n  return { secret: await relay.outbound.endpoints.rotateSecret(endpoint.id) };\n}\n",[1779],{"type":373,"tag":385,"props":1780,"children":1781},{"__ignoreMap":345},[1782,1790,1802,1809,1834,1859,1884,1891,1951,1958,2041,2070,2136,2185,2192,2251,2299,2306,2317,2334,2368,2376,2384,2401,2409,2430,2438,2450,2465,2473,2516,2523,2530,2537,2577,2604,2659,2680,2700,2707,2714,2755,2783,2835,2882,2902,2910,2918,2959,2987,3039,3048,3069,3089,3097,3105,3182,3210,3262,3271,3303],{"type":373,"tag":421,"props":1783,"children":1784},{"class":423,"line":424},[1785],{"type":373,"tag":421,"props":1786,"children":1787},{"style":609},[1788],{"type":382,"value":1789},"// app/settings/webhooks/actions.ts\n",{"type":373,"tag":421,"props":1791,"children":1792},{"class":423,"line":433},[1793,1798],{"type":373,"tag":421,"props":1794,"children":1795},{"style":583},[1796],{"type":382,"value":1797},"\"use server\"",{"type":373,"tag":421,"props":1799,"children":1800},{"style":618},[1801],{"type":382,"value":747},{"type":373,"tag":421,"props":1803,"children":1804},{"class":423,"line":442},[1805],{"type":373,"tag":421,"props":1806,"children":1807},{"emptyLinePlaceholder":779},[1808],{"type":382,"value":782},{"type":373,"tag":421,"props":1810,"children":1811},{"class":423,"line":451},[1812,1816,1821,1825,1830],{"type":373,"tag":421,"props":1813,"children":1814},{"style":624},[1815],{"type":382,"value":737},{"type":373,"tag":421,"props":1817,"children":1818},{"style":618},[1819],{"type":382,"value":1820}," { revalidatePath } ",{"type":373,"tag":421,"props":1822,"children":1823},{"style":624},[1824],{"type":382,"value":764},{"type":373,"tag":421,"props":1826,"children":1827},{"style":583},[1828],{"type":382,"value":1829}," \"next/cache\"",{"type":373,"tag":421,"props":1831,"children":1832},{"style":618},[1833],{"type":382,"value":747},{"type":373,"tag":421,"props":1835,"children":1836},{"class":423,"line":460},[1837,1841,1846,1850,1855],{"type":373,"tag":421,"props":1838,"children":1839},{"style":624},[1840],{"type":382,"value":737},{"type":373,"tag":421,"props":1842,"children":1843},{"style":618},[1844],{"type":382,"value":1845}," { getCurrentOrg } ",{"type":373,"tag":421,"props":1847,"children":1848},{"style":624},[1849],{"type":382,"value":764},{"type":373,"tag":421,"props":1851,"children":1852},{"style":583},[1853],{"type":382,"value":1854}," \"@/lib/auth\"",{"type":373,"tag":421,"props":1856,"children":1857},{"style":618},[1858],{"type":382,"value":747},{"type":373,"tag":421,"props":1860,"children":1861},{"class":423,"line":469},[1862,1866,1871,1875,1880],{"type":373,"tag":421,"props":1863,"children":1864},{"style":624},[1865],{"type":382,"value":737},{"type":373,"tag":421,"props":1867,"children":1868},{"style":618},[1869],{"type":382,"value":1870}," { ensureConsumer, getOwnedEndpoint, relay } ",{"type":373,"tag":421,"props":1872,"children":1873},{"style":624},[1874],{"type":382,"value":764},{"type":373,"tag":421,"props":1876,"children":1877},{"style":583},[1878],{"type":382,"value":1879}," \"@/lib/webhooks\"",{"type":373,"tag":421,"props":1881,"children":1882},{"style":618},[1883],{"type":382,"value":747},{"type":373,"tag":421,"props":1885,"children":1886},{"class":423,"line":478},[1887],{"type":373,"tag":421,"props":1888,"children":1889},{"emptyLinePlaceholder":779},[1890],{"type":382,"value":782},{"type":373,"tag":421,"props":1892,"children":1893},{"class":423,"line":487},[1894,1898,1903,1908,1912,1916,1921,1926,1930,1934,1939,1943,1947],{"type":373,"tag":421,"props":1895,"children":1896},{"style":624},[1897],{"type":382,"value":790},{"type":373,"tag":421,"props":1899,"children":1900},{"style":624},[1901],{"type":382,"value":1902}," type",{"type":373,"tag":421,"props":1904,"children":1905},{"style":577},[1906],{"type":382,"value":1907}," AddEndpointState",{"type":373,"tag":421,"props":1909,"children":1910},{"style":624},[1911],{"type":382,"value":806},{"type":373,"tag":421,"props":1913,"children":1914},{"style":618},[1915],{"type":382,"value":923},{"type":373,"tag":421,"props":1917,"children":1918},{"style":910},[1919],{"type":382,"value":1920},"error",{"type":373,"tag":421,"props":1922,"children":1923},{"style":624},[1924],{"type":382,"value":1925},"?:",{"type":373,"tag":421,"props":1927,"children":1928},{"style":798},[1929],{"type":382,"value":937},{"type":373,"tag":421,"props":1931,"children":1932},{"style":618},[1933],{"type":382,"value":942},{"type":373,"tag":421,"props":1935,"children":1936},{"style":910},[1937],{"type":382,"value":1938},"secret",{"type":373,"tag":421,"props":1940,"children":1941},{"style":624},[1942],{"type":382,"value":1925},{"type":373,"tag":421,"props":1944,"children":1945},{"style":798},[1946],{"type":382,"value":937},{"type":373,"tag":421,"props":1948,"children":1949},{"style":618},[1950],{"type":382,"value":1756},{"type":373,"tag":421,"props":1952,"children":1953},{"class":423,"line":865},[1954],{"type":373,"tag":421,"props":1955,"children":1956},{"emptyLinePlaceholder":779},[1957],{"type":382,"value":782},{"type":373,"tag":421,"props":1959,"children":1960},{"class":423,"line":873},[1961,1965,1969,1973,1978,1982,1987,1991,1995,1999,2004,2008,2013,2018,2022,2026,2031,2036],{"type":373,"tag":421,"props":1962,"children":1963},{"style":624},[1964],{"type":382,"value":790},{"type":373,"tag":421,"props":1966,"children":1967},{"style":624},[1968],{"type":382,"value":892},{"type":373,"tag":421,"props":1970,"children":1971},{"style":624},[1972],{"type":382,"value":897},{"type":373,"tag":421,"props":1974,"children":1975},{"style":577},[1976],{"type":382,"value":1977}," addEndpoint",{"type":373,"tag":421,"props":1979,"children":1980},{"style":618},[1981],{"type":382,"value":907},{"type":373,"tag":421,"props":1983,"children":1984},{"style":910},[1985],{"type":382,"value":1986},"_prev",{"type":373,"tag":421,"props":1988,"children":1989},{"style":624},[1990],{"type":382,"value":918},{"type":373,"tag":421,"props":1992,"children":1993},{"style":577},[1994],{"type":382,"value":1907},{"type":373,"tag":421,"props":1996,"children":1997},{"style":618},[1998],{"type":382,"value":1053},{"type":373,"tag":421,"props":2000,"children":2001},{"style":910},[2002],{"type":382,"value":2003},"form",{"type":373,"tag":421,"props":2005,"children":2006},{"style":624},[2007],{"type":382,"value":918},{"type":373,"tag":421,"props":2009,"children":2010},{"style":577},[2011],{"type":382,"value":2012}," FormData",{"type":373,"tag":421,"props":2014,"children":2015},{"style":618},[2016],{"type":382,"value":2017},")",{"type":373,"tag":421,"props":2019,"children":2020},{"style":624},[2021],{"type":382,"value":918},{"type":373,"tag":421,"props":2023,"children":2024},{"style":577},[2025],{"type":382,"value":1686},{"type":373,"tag":421,"props":2027,"children":2028},{"style":618},[2029],{"type":382,"value":2030},"\u003C",{"type":373,"tag":421,"props":2032,"children":2033},{"style":577},[2034],{"type":382,"value":2035},"AddEndpointState",{"type":373,"tag":421,"props":2037,"children":2038},{"style":618},[2039],{"type":382,"value":2040},"> {\n",{"type":373,"tag":421,"props":2042,"children":2043},{"class":423,"line":882},[2044,2048,2053,2057,2061,2065],{"type":373,"tag":421,"props":2045,"children":2046},{"style":624},[2047],{"type":382,"value":1080},{"type":373,"tag":421,"props":2049,"children":2050},{"style":798},[2051],{"type":382,"value":2052}," org",{"type":373,"tag":421,"props":2054,"children":2055},{"style":624},[2056],{"type":382,"value":806},{"type":373,"tag":421,"props":2058,"children":2059},{"style":624},[2060],{"type":382,"value":1094},{"type":373,"tag":421,"props":2062,"children":2063},{"style":577},[2064],{"type":382,"value":1672},{"type":373,"tag":421,"props":2066,"children":2067},{"style":618},[2068],{"type":382,"value":2069},"();\n",{"type":373,"tag":421,"props":2071,"children":2072},{"class":423,"line":963},[2073,2077,2082,2086,2091,2096,2100,2104,2109,2113,2118,2123,2127,2132],{"type":373,"tag":421,"props":2074,"children":2075},{"style":624},[2076],{"type":382,"value":1080},{"type":373,"tag":421,"props":2078,"children":2079},{"style":798},[2080],{"type":382,"value":2081}," url",{"type":373,"tag":421,"props":2083,"children":2084},{"style":624},[2085],{"type":382,"value":806},{"type":373,"tag":421,"props":2087,"children":2088},{"style":577},[2089],{"type":382,"value":2090}," String",{"type":373,"tag":421,"props":2092,"children":2093},{"style":618},[2094],{"type":382,"value":2095},"(form.",{"type":373,"tag":421,"props":2097,"children":2098},{"style":577},[2099],{"type":382,"value":1104},{"type":373,"tag":421,"props":2101,"children":2102},{"style":618},[2103],{"type":382,"value":907},{"type":373,"tag":421,"props":2105,"children":2106},{"style":583},[2107],{"type":382,"value":2108},"\"url\"",{"type":373,"tag":421,"props":2110,"children":2111},{"style":618},[2112],{"type":382,"value":1350},{"type":373,"tag":421,"props":2114,"children":2115},{"style":624},[2116],{"type":382,"value":2117},"??",{"type":373,"tag":421,"props":2119,"children":2120},{"style":583},[2121],{"type":382,"value":2122}," \"\"",{"type":373,"tag":421,"props":2124,"children":2125},{"style":618},[2126],{"type":382,"value":557},{"type":373,"tag":421,"props":2128,"children":2129},{"style":577},[2130],{"type":382,"value":2131},"trim",{"type":373,"tag":421,"props":2133,"children":2134},{"style":618},[2135],{"type":382,"value":2069},{"type":373,"tag":421,"props":2137,"children":2138},{"class":423,"line":987},[2139,2143,2148,2152,2157,2162,2166,2171,2175,2180],{"type":373,"tag":421,"props":2140,"children":2141},{"style":624},[2142],{"type":382,"value":1080},{"type":373,"tag":421,"props":2144,"children":2145},{"style":798},[2146],{"type":382,"value":2147}," eventTypes",{"type":373,"tag":421,"props":2149,"children":2150},{"style":624},[2151],{"type":382,"value":806},{"type":373,"tag":421,"props":2153,"children":2154},{"style":618},[2155],{"type":382,"value":2156}," form.",{"type":373,"tag":421,"props":2158,"children":2159},{"style":577},[2160],{"type":382,"value":2161},"getAll",{"type":373,"tag":421,"props":2163,"children":2164},{"style":618},[2165],{"type":382,"value":907},{"type":373,"tag":421,"props":2167,"children":2168},{"style":583},[2169],{"type":382,"value":2170},"\"eventTypes\"",{"type":373,"tag":421,"props":2172,"children":2173},{"style":618},[2174],{"type":382,"value":557},{"type":373,"tag":421,"props":2176,"children":2177},{"style":577},[2178],{"type":382,"value":2179},"map",{"type":373,"tag":421,"props":2181,"children":2182},{"style":618},[2183],{"type":382,"value":2184},"(String);\n",{"type":373,"tag":421,"props":2186,"children":2187},{"class":423,"line":996},[2188],{"type":373,"tag":421,"props":2189,"children":2190},{"emptyLinePlaceholder":779},[2191],{"type":382,"value":782},{"type":373,"tag":421,"props":2193,"children":2194},{"class":423,"line":1004},[2195,2199,2204,2209,2214,2219,2223,2228,2233,2237,2242,2247],{"type":373,"tag":421,"props":2196,"children":2197},{"style":624},[2198],{"type":382,"value":1118},{"type":373,"tag":421,"props":2200,"children":2201},{"style":618},[2202],{"type":382,"value":2203}," (",{"type":373,"tag":421,"props":2205,"children":2206},{"style":624},[2207],{"type":382,"value":2208},"!",{"type":373,"tag":421,"props":2210,"children":2211},{"style":618},[2212],{"type":382,"value":2213},"url.",{"type":373,"tag":421,"props":2215,"children":2216},{"style":577},[2217],{"type":382,"value":2218},"startsWith",{"type":373,"tag":421,"props":2220,"children":2221},{"style":618},[2222],{"type":382,"value":907},{"type":373,"tag":421,"props":2224,"children":2225},{"style":583},[2226],{"type":382,"value":2227},"\"https://\"",{"type":373,"tag":421,"props":2229,"children":2230},{"style":618},[2231],{"type":382,"value":2232},")) ",{"type":373,"tag":421,"props":2234,"children":2235},{"style":624},[2236],{"type":382,"value":1355},{"type":373,"tag":421,"props":2238,"children":2239},{"style":618},[2240],{"type":382,"value":2241}," { error: ",{"type":373,"tag":421,"props":2243,"children":2244},{"style":583},[2245],{"type":382,"value":2246},"\"The URL must start with https://\"",{"type":373,"tag":421,"props":2248,"children":2249},{"style":618},[2250],{"type":382,"value":1756},{"type":373,"tag":421,"props":2252,"children":2253},{"class":423,"line":1013},[2254,2258,2263,2268,2273,2278,2282,2286,2290,2295],{"type":373,"tag":421,"props":2255,"children":2256},{"style":624},[2257],{"type":382,"value":1118},{"type":373,"tag":421,"props":2259,"children":2260},{"style":618},[2261],{"type":382,"value":2262}," (eventTypes.",{"type":373,"tag":421,"props":2264,"children":2265},{"style":798},[2266],{"type":382,"value":2267},"length",{"type":373,"tag":421,"props":2269,"children":2270},{"style":624},[2271],{"type":382,"value":2272}," ===",{"type":373,"tag":421,"props":2274,"children":2275},{"style":798},[2276],{"type":382,"value":2277}," 0",{"type":373,"tag":421,"props":2279,"children":2280},{"style":618},[2281],{"type":382,"value":1350},{"type":373,"tag":421,"props":2283,"children":2284},{"style":624},[2285],{"type":382,"value":1355},{"type":373,"tag":421,"props":2287,"children":2288},{"style":618},[2289],{"type":382,"value":2241},{"type":373,"tag":421,"props":2291,"children":2292},{"style":583},[2293],{"type":382,"value":2294},"\"Pick at least one event\"",{"type":373,"tag":421,"props":2296,"children":2297},{"style":618},[2298],{"type":382,"value":1756},{"type":373,"tag":421,"props":2300,"children":2301},{"class":423,"line":1074},[2302],{"type":373,"tag":421,"props":2303,"children":2304},{"emptyLinePlaceholder":779},[2305],{"type":382,"value":782},{"type":373,"tag":421,"props":2307,"children":2308},{"class":423,"line":1112},[2309,2313],{"type":373,"tag":421,"props":2310,"children":2311},{"style":624},[2312],{"type":382,"value":1250},{"type":373,"tag":421,"props":2314,"children":2315},{"style":618},[2316],{"type":382,"value":1255},{"type":373,"tag":421,"props":2318,"children":2319},{"class":423,"line":1164},[2320,2325,2329],{"type":373,"tag":421,"props":2321,"children":2322},{"style":624},[2323],{"type":382,"value":2324},"    await",{"type":373,"tag":421,"props":2326,"children":2327},{"style":577},[2328],{"type":382,"value":902},{"type":373,"tag":421,"props":2330,"children":2331},{"style":618},[2332],{"type":382,"value":2333},"(org);\n",{"type":373,"tag":421,"props":2335,"children":2336},{"class":423,"line":1178},[2337,2342,2346,2350,2354,2358,2363],{"type":373,"tag":421,"props":2338,"children":2339},{"style":624},[2340],{"type":382,"value":2341},"    const",{"type":373,"tag":421,"props":2343,"children":2344},{"style":798},[2345],{"type":382,"value":1085},{"type":373,"tag":421,"props":2347,"children":2348},{"style":624},[2349],{"type":382,"value":806},{"type":373,"tag":421,"props":2351,"children":2352},{"style":624},[2353],{"type":382,"value":1094},{"type":373,"tag":421,"props":2355,"children":2356},{"style":618},[2357],{"type":382,"value":1099},{"type":373,"tag":421,"props":2359,"children":2360},{"style":577},[2361],{"type":382,"value":2362},"create",{"type":373,"tag":421,"props":2364,"children":2365},{"style":618},[2366],{"type":382,"value":2367},"(org.id, {\n",{"type":373,"tag":421,"props":2369,"children":2370},{"class":423,"line":1186},[2371],{"type":373,"tag":421,"props":2372,"children":2373},{"style":618},[2374],{"type":382,"value":2375},"      url,\n",{"type":373,"tag":421,"props":2377,"children":2378},{"class":423,"line":1194},[2379],{"type":373,"tag":421,"props":2380,"children":2381},{"style":618},[2382],{"type":382,"value":2383},"      eventTypes,\n",{"type":373,"tag":421,"props":2385,"children":2386},{"class":423,"line":1203},[2387,2392,2397],{"type":373,"tag":421,"props":2388,"children":2389},{"style":618},[2390],{"type":382,"value":2391},"      autoDisable: ",{"type":373,"tag":421,"props":2393,"children":2394},{"style":798},[2395],{"type":382,"value":2396},"true",{"type":373,"tag":421,"props":2398,"children":2399},{"style":618},[2400],{"type":382,"value":838},{"type":373,"tag":421,"props":2402,"children":2403},{"class":423,"line":1244},[2404],{"type":373,"tag":421,"props":2405,"children":2406},{"style":618},[2407],{"type":382,"value":2408},"    });\n",{"type":373,"tag":421,"props":2410,"children":2411},{"class":423,"line":1258},[2412,2417,2421,2426],{"type":373,"tag":421,"props":2413,"children":2414},{"style":577},[2415],{"type":382,"value":2416},"    revalidatePath",{"type":373,"tag":421,"props":2418,"children":2419},{"style":618},[2420],{"type":382,"value":907},{"type":373,"tag":421,"props":2422,"children":2423},{"style":583},[2424],{"type":382,"value":2425},"\"/settings/webhooks\"",{"type":373,"tag":421,"props":2427,"children":2428},{"style":618},[2429],{"type":382,"value":1161},{"type":373,"tag":421,"props":2431,"children":2432},{"class":423,"line":1285},[2433],{"type":373,"tag":421,"props":2434,"children":2435},{"style":609},[2436],{"type":382,"value":2437},"    // Shown once. The customer verifies signatures with it.\n",{"type":373,"tag":421,"props":2439,"children":2440},{"class":423,"line":1304},[2441,2445],{"type":373,"tag":421,"props":2442,"children":2443},{"style":624},[2444],{"type":382,"value":1264},{"type":373,"tag":421,"props":2446,"children":2447},{"style":618},[2448],{"type":382,"value":2449}," { secret: endpoint.secret };\n",{"type":373,"tag":421,"props":2451,"children":2452},{"class":423,"line":1363},[2453,2457,2461],{"type":373,"tag":421,"props":2454,"children":2455},{"style":618},[2456],{"type":382,"value":1291},{"type":373,"tag":421,"props":2458,"children":2459},{"style":624},[2460],{"type":382,"value":1296},{"type":373,"tag":421,"props":2462,"children":2463},{"style":618},[2464],{"type":382,"value":1301},{"type":373,"tag":421,"props":2466,"children":2467},{"class":423,"line":1377},[2468],{"type":373,"tag":421,"props":2469,"children":2470},{"style":609},[2471],{"type":382,"value":2472},"    // Private/loopback hosts, duplicate URLs and plan limits are rejected here.\n",{"type":373,"tag":421,"props":2474,"children":2475},{"class":423,"line":1386},[2476,2480,2485,2489,2493,2498,2503,2507,2512],{"type":373,"tag":421,"props":2477,"children":2478},{"style":624},[2479],{"type":382,"value":1264},{"type":373,"tag":421,"props":2481,"children":2482},{"style":618},[2483],{"type":382,"value":2484}," { error: err ",{"type":373,"tag":421,"props":2486,"children":2487},{"style":624},[2488],{"type":382,"value":1320},{"type":373,"tag":421,"props":2490,"children":2491},{"style":577},[2492],{"type":382,"value":1147},{"type":373,"tag":421,"props":2494,"children":2495},{"style":624},[2496],{"type":382,"value":2497}," ?",{"type":373,"tag":421,"props":2499,"children":2500},{"style":618},[2501],{"type":382,"value":2502}," err.message ",{"type":373,"tag":421,"props":2504,"children":2505},{"style":624},[2506],{"type":382,"value":918},{"type":373,"tag":421,"props":2508,"children":2509},{"style":583},[2510],{"type":382,"value":2511}," \"Could not add the endpoint\"",{"type":373,"tag":421,"props":2513,"children":2514},{"style":618},[2515],{"type":382,"value":1756},{"type":373,"tag":421,"props":2517,"children":2518},{"class":423,"line":1394},[2519],{"type":373,"tag":421,"props":2520,"children":2521},{"style":618},[2522],{"type":382,"value":1383},{"type":373,"tag":421,"props":2524,"children":2525},{"class":423,"line":1402},[2526],{"type":373,"tag":421,"props":2527,"children":2528},{"style":618},[2529],{"type":382,"value":993},{"type":373,"tag":421,"props":2531,"children":2532},{"class":423,"line":1411},[2533],{"type":373,"tag":421,"props":2534,"children":2535},{"emptyLinePlaceholder":779},[2536],{"type":382,"value":782},{"type":373,"tag":421,"props":2538,"children":2539},{"class":423,"line":1504},[2540,2544,2548,2552,2557,2561,2565,2569,2573],{"type":373,"tag":421,"props":2541,"children":2542},{"style":624},[2543],{"type":382,"value":790},{"type":373,"tag":421,"props":2545,"children":2546},{"style":624},[2547],{"type":382,"value":892},{"type":373,"tag":421,"props":2549,"children":2550},{"style":624},[2551],{"type":382,"value":897},{"type":373,"tag":421,"props":2553,"children":2554},{"style":577},[2555],{"type":382,"value":2556}," deleteEndpoint",{"type":373,"tag":421,"props":2558,"children":2559},{"style":618},[2560],{"type":382,"value":907},{"type":373,"tag":421,"props":2562,"children":2563},{"style":910},[2564],{"type":382,"value":2003},{"type":373,"tag":421,"props":2566,"children":2567},{"style":624},[2568],{"type":382,"value":918},{"type":373,"tag":421,"props":2570,"children":2571},{"style":577},[2572],{"type":382,"value":2012},{"type":373,"tag":421,"props":2574,"children":2575},{"style":618},[2576],{"type":382,"value":1071},{"type":373,"tag":421,"props":2578,"children":2579},{"class":423,"line":1516},[2580,2584,2588,2592,2596,2600],{"type":373,"tag":421,"props":2581,"children":2582},{"style":624},[2583],{"type":382,"value":1080},{"type":373,"tag":421,"props":2585,"children":2586},{"style":798},[2587],{"type":382,"value":2052},{"type":373,"tag":421,"props":2589,"children":2590},{"style":624},[2591],{"type":382,"value":806},{"type":373,"tag":421,"props":2593,"children":2594},{"style":624},[2595],{"type":382,"value":1094},{"type":373,"tag":421,"props":2597,"children":2598},{"style":577},[2599],{"type":382,"value":1672},{"type":373,"tag":421,"props":2601,"children":2602},{"style":618},[2603],{"type":382,"value":2069},{"type":373,"tag":421,"props":2605,"children":2606},{"class":423,"line":1543},[2607,2611,2615,2619,2623,2627,2632,2637,2641,2645,2649,2654],{"type":373,"tag":421,"props":2608,"children":2609},{"style":624},[2610],{"type":382,"value":1080},{"type":373,"tag":421,"props":2612,"children":2613},{"style":798},[2614],{"type":382,"value":1085},{"type":373,"tag":421,"props":2616,"children":2617},{"style":624},[2618],{"type":382,"value":806},{"type":373,"tag":421,"props":2620,"children":2621},{"style":624},[2622],{"type":382,"value":1094},{"type":373,"tag":421,"props":2624,"children":2625},{"style":577},[2626],{"type":382,"value":1031},{"type":373,"tag":421,"props":2628,"children":2629},{"style":618},[2630],{"type":382,"value":2631},"(org.id, ",{"type":373,"tag":421,"props":2633,"children":2634},{"style":577},[2635],{"type":382,"value":2636},"String",{"type":373,"tag":421,"props":2638,"children":2639},{"style":618},[2640],{"type":382,"value":2095},{"type":373,"tag":421,"props":2642,"children":2643},{"style":577},[2644],{"type":382,"value":1104},{"type":373,"tag":421,"props":2646,"children":2647},{"style":618},[2648],{"type":382,"value":907},{"type":373,"tag":421,"props":2650,"children":2651},{"style":583},[2652],{"type":382,"value":2653},"\"endpointId\"",{"type":373,"tag":421,"props":2655,"children":2656},{"style":618},[2657],{"type":382,"value":2658},")));\n",{"type":373,"tag":421,"props":2660,"children":2661},{"class":423,"line":1559},[2662,2666,2670,2675],{"type":373,"tag":421,"props":2663,"children":2664},{"style":624},[2665],{"type":382,"value":969},{"type":373,"tag":421,"props":2667,"children":2668},{"style":618},[2669],{"type":382,"value":1099},{"type":373,"tag":421,"props":2671,"children":2672},{"style":577},[2673],{"type":382,"value":2674},"delete",{"type":373,"tag":421,"props":2676,"children":2677},{"style":618},[2678],{"type":382,"value":2679},"(endpoint.id);\n",{"type":373,"tag":421,"props":2681,"children":2682},{"class":423,"line":1612},[2683,2688,2692,2696],{"type":373,"tag":421,"props":2684,"children":2685},{"style":577},[2686],{"type":382,"value":2687},"  revalidatePath",{"type":373,"tag":421,"props":2689,"children":2690},{"style":618},[2691],{"type":382,"value":907},{"type":373,"tag":421,"props":2693,"children":2694},{"style":583},[2695],{"type":382,"value":2425},{"type":373,"tag":421,"props":2697,"children":2698},{"style":618},[2699],{"type":382,"value":1161},{"type":373,"tag":421,"props":2701,"children":2702},{"class":423,"line":1624},[2703],{"type":373,"tag":421,"props":2704,"children":2705},{"style":618},[2706],{"type":382,"value":993},{"type":373,"tag":421,"props":2708,"children":2709},{"class":423,"line":1632},[2710],{"type":373,"tag":421,"props":2711,"children":2712},{"emptyLinePlaceholder":779},[2713],{"type":382,"value":782},{"type":373,"tag":421,"props":2715,"children":2717},{"class":423,"line":2716},41,[2718,2722,2726,2730,2735,2739,2743,2747,2751],{"type":373,"tag":421,"props":2719,"children":2720},{"style":624},[2721],{"type":382,"value":790},{"type":373,"tag":421,"props":2723,"children":2724},{"style":624},[2725],{"type":382,"value":892},{"type":373,"tag":421,"props":2727,"children":2728},{"style":624},[2729],{"type":382,"value":897},{"type":373,"tag":421,"props":2731,"children":2732},{"style":577},[2733],{"type":382,"value":2734}," retryDelivery",{"type":373,"tag":421,"props":2736,"children":2737},{"style":618},[2738],{"type":382,"value":907},{"type":373,"tag":421,"props":2740,"children":2741},{"style":910},[2742],{"type":382,"value":2003},{"type":373,"tag":421,"props":2744,"children":2745},{"style":624},[2746],{"type":382,"value":918},{"type":373,"tag":421,"props":2748,"children":2749},{"style":577},[2750],{"type":382,"value":2012},{"type":373,"tag":421,"props":2752,"children":2753},{"style":618},[2754],{"type":382,"value":1071},{"type":373,"tag":421,"props":2756,"children":2758},{"class":423,"line":2757},42,[2759,2763,2767,2771,2775,2779],{"type":373,"tag":421,"props":2760,"children":2761},{"style":624},[2762],{"type":382,"value":1080},{"type":373,"tag":421,"props":2764,"children":2765},{"style":798},[2766],{"type":382,"value":2052},{"type":373,"tag":421,"props":2768,"children":2769},{"style":624},[2770],{"type":382,"value":806},{"type":373,"tag":421,"props":2772,"children":2773},{"style":624},[2774],{"type":382,"value":1094},{"type":373,"tag":421,"props":2776,"children":2777},{"style":577},[2778],{"type":382,"value":1672},{"type":373,"tag":421,"props":2780,"children":2781},{"style":618},[2782],{"type":382,"value":2069},{"type":373,"tag":421,"props":2784,"children":2786},{"class":423,"line":2785},43,[2787,2791,2795,2799,2803,2807,2811,2815,2819,2823,2827,2831],{"type":373,"tag":421,"props":2788,"children":2789},{"style":624},[2790],{"type":382,"value":1080},{"type":373,"tag":421,"props":2792,"children":2793},{"style":798},[2794],{"type":382,"value":1085},{"type":373,"tag":421,"props":2796,"children":2797},{"style":624},[2798],{"type":382,"value":806},{"type":373,"tag":421,"props":2800,"children":2801},{"style":624},[2802],{"type":382,"value":1094},{"type":373,"tag":421,"props":2804,"children":2805},{"style":577},[2806],{"type":382,"value":1031},{"type":373,"tag":421,"props":2808,"children":2809},{"style":618},[2810],{"type":382,"value":2631},{"type":373,"tag":421,"props":2812,"children":2813},{"style":577},[2814],{"type":382,"value":2636},{"type":373,"tag":421,"props":2816,"children":2817},{"style":618},[2818],{"type":382,"value":2095},{"type":373,"tag":421,"props":2820,"children":2821},{"style":577},[2822],{"type":382,"value":1104},{"type":373,"tag":421,"props":2824,"children":2825},{"style":618},[2826],{"type":382,"value":907},{"type":373,"tag":421,"props":2828,"children":2829},{"style":583},[2830],{"type":382,"value":2653},{"type":373,"tag":421,"props":2832,"children":2833},{"style":618},[2834],{"type":382,"value":2658},{"type":373,"tag":421,"props":2836,"children":2838},{"class":423,"line":2837},44,[2839,2843,2847,2852,2857,2861,2865,2869,2873,2878],{"type":373,"tag":421,"props":2840,"children":2841},{"style":624},[2842],{"type":382,"value":969},{"type":373,"tag":421,"props":2844,"children":2845},{"style":618},[2846],{"type":382,"value":1099},{"type":373,"tag":421,"props":2848,"children":2849},{"style":577},[2850],{"type":382,"value":2851},"retry",{"type":373,"tag":421,"props":2853,"children":2854},{"style":618},[2855],{"type":382,"value":2856},"(endpoint.id, ",{"type":373,"tag":421,"props":2858,"children":2859},{"style":577},[2860],{"type":382,"value":2636},{"type":373,"tag":421,"props":2862,"children":2863},{"style":618},[2864],{"type":382,"value":2095},{"type":373,"tag":421,"props":2866,"children":2867},{"style":577},[2868],{"type":382,"value":1104},{"type":373,"tag":421,"props":2870,"children":2871},{"style":618},[2872],{"type":382,"value":907},{"type":373,"tag":421,"props":2874,"children":2875},{"style":583},[2876],{"type":382,"value":2877},"\"messageId\"",{"type":373,"tag":421,"props":2879,"children":2880},{"style":618},[2881],{"type":382,"value":2658},{"type":373,"tag":421,"props":2883,"children":2885},{"class":423,"line":2884},45,[2886,2890,2894,2898],{"type":373,"tag":421,"props":2887,"children":2888},{"style":577},[2889],{"type":382,"value":2687},{"type":373,"tag":421,"props":2891,"children":2892},{"style":618},[2893],{"type":382,"value":907},{"type":373,"tag":421,"props":2895,"children":2896},{"style":583},[2897],{"type":382,"value":2425},{"type":373,"tag":421,"props":2899,"children":2900},{"style":618},[2901],{"type":382,"value":1161},{"type":373,"tag":421,"props":2903,"children":2905},{"class":423,"line":2904},46,[2906],{"type":373,"tag":421,"props":2907,"children":2908},{"style":618},[2909],{"type":382,"value":993},{"type":373,"tag":421,"props":2911,"children":2913},{"class":423,"line":2912},47,[2914],{"type":373,"tag":421,"props":2915,"children":2916},{"emptyLinePlaceholder":779},[2917],{"type":382,"value":782},{"type":373,"tag":421,"props":2919,"children":2921},{"class":423,"line":2920},48,[2922,2926,2930,2934,2939,2943,2947,2951,2955],{"type":373,"tag":421,"props":2923,"children":2924},{"style":624},[2925],{"type":382,"value":790},{"type":373,"tag":421,"props":2927,"children":2928},{"style":624},[2929],{"type":382,"value":892},{"type":373,"tag":421,"props":2931,"children":2932},{"style":624},[2933],{"type":382,"value":897},{"type":373,"tag":421,"props":2935,"children":2936},{"style":577},[2937],{"type":382,"value":2938}," resendFailed",{"type":373,"tag":421,"props":2940,"children":2941},{"style":618},[2942],{"type":382,"value":907},{"type":373,"tag":421,"props":2944,"children":2945},{"style":910},[2946],{"type":382,"value":2003},{"type":373,"tag":421,"props":2948,"children":2949},{"style":624},[2950],{"type":382,"value":918},{"type":373,"tag":421,"props":2952,"children":2953},{"style":577},[2954],{"type":382,"value":2012},{"type":373,"tag":421,"props":2956,"children":2957},{"style":618},[2958],{"type":382,"value":1071},{"type":373,"tag":421,"props":2960,"children":2962},{"class":423,"line":2961},49,[2963,2967,2971,2975,2979,2983],{"type":373,"tag":421,"props":2964,"children":2965},{"style":624},[2966],{"type":382,"value":1080},{"type":373,"tag":421,"props":2968,"children":2969},{"style":798},[2970],{"type":382,"value":2052},{"type":373,"tag":421,"props":2972,"children":2973},{"style":624},[2974],{"type":382,"value":806},{"type":373,"tag":421,"props":2976,"children":2977},{"style":624},[2978],{"type":382,"value":1094},{"type":373,"tag":421,"props":2980,"children":2981},{"style":577},[2982],{"type":382,"value":1672},{"type":373,"tag":421,"props":2984,"children":2985},{"style":618},[2986],{"type":382,"value":2069},{"type":373,"tag":421,"props":2988,"children":2990},{"class":423,"line":2989},50,[2991,2995,2999,3003,3007,3011,3015,3019,3023,3027,3031,3035],{"type":373,"tag":421,"props":2992,"children":2993},{"style":624},[2994],{"type":382,"value":1080},{"type":373,"tag":421,"props":2996,"children":2997},{"style":798},[2998],{"type":382,"value":1085},{"type":373,"tag":421,"props":3000,"children":3001},{"style":624},[3002],{"type":382,"value":806},{"type":373,"tag":421,"props":3004,"children":3005},{"style":624},[3006],{"type":382,"value":1094},{"type":373,"tag":421,"props":3008,"children":3009},{"style":577},[3010],{"type":382,"value":1031},{"type":373,"tag":421,"props":3012,"children":3013},{"style":618},[3014],{"type":382,"value":2631},{"type":373,"tag":421,"props":3016,"children":3017},{"style":577},[3018],{"type":382,"value":2636},{"type":373,"tag":421,"props":3020,"children":3021},{"style":618},[3022],{"type":382,"value":2095},{"type":373,"tag":421,"props":3024,"children":3025},{"style":577},[3026],{"type":382,"value":1104},{"type":373,"tag":421,"props":3028,"children":3029},{"style":618},[3030],{"type":382,"value":907},{"type":373,"tag":421,"props":3032,"children":3033},{"style":583},[3034],{"type":382,"value":2653},{"type":373,"tag":421,"props":3036,"children":3037},{"style":618},[3038],{"type":382,"value":2658},{"type":373,"tag":421,"props":3040,"children":3042},{"class":423,"line":3041},51,[3043],{"type":373,"tag":421,"props":3044,"children":3045},{"style":609},[3046],{"type":382,"value":3047},"  // Re-send everything that exhausted its retries in the last 24 hours.\n",{"type":373,"tag":421,"props":3049,"children":3051},{"class":423,"line":3050},52,[3052,3056,3060,3065],{"type":373,"tag":421,"props":3053,"children":3054},{"style":624},[3055],{"type":382,"value":969},{"type":373,"tag":421,"props":3057,"children":3058},{"style":618},[3059],{"type":382,"value":1099},{"type":373,"tag":421,"props":3061,"children":3062},{"style":577},[3063],{"type":382,"value":3064},"recover",{"type":373,"tag":421,"props":3066,"children":3067},{"style":618},[3068],{"type":382,"value":2679},{"type":373,"tag":421,"props":3070,"children":3072},{"class":423,"line":3071},53,[3073,3077,3081,3085],{"type":373,"tag":421,"props":3074,"children":3075},{"style":577},[3076],{"type":382,"value":2687},{"type":373,"tag":421,"props":3078,"children":3079},{"style":618},[3080],{"type":382,"value":907},{"type":373,"tag":421,"props":3082,"children":3083},{"style":583},[3084],{"type":382,"value":2425},{"type":373,"tag":421,"props":3086,"children":3087},{"style":618},[3088],{"type":382,"value":1161},{"type":373,"tag":421,"props":3090,"children":3092},{"class":423,"line":3091},54,[3093],{"type":373,"tag":421,"props":3094,"children":3095},{"style":618},[3096],{"type":382,"value":993},{"type":373,"tag":421,"props":3098,"children":3100},{"class":423,"line":3099},55,[3101],{"type":373,"tag":421,"props":3102,"children":3103},{"emptyLinePlaceholder":779},[3104],{"type":382,"value":782},{"type":373,"tag":421,"props":3106,"children":3108},{"class":423,"line":3107},56,[3109,3113,3117,3121,3126,3130,3134,3138,3142,3146,3150,3154,3158,3162,3166,3170,3174,3178],{"type":373,"tag":421,"props":3110,"children":3111},{"style":624},[3112],{"type":382,"value":790},{"type":373,"tag":421,"props":3114,"children":3115},{"style":624},[3116],{"type":382,"value":892},{"type":373,"tag":421,"props":3118,"children":3119},{"style":624},[3120],{"type":382,"value":897},{"type":373,"tag":421,"props":3122,"children":3123},{"style":577},[3124],{"type":382,"value":3125}," rotateSecret",{"type":373,"tag":421,"props":3127,"children":3128},{"style":618},[3129],{"type":382,"value":907},{"type":373,"tag":421,"props":3131,"children":3132},{"style":910},[3133],{"type":382,"value":1986},{"type":373,"tag":421,"props":3135,"children":3136},{"style":624},[3137],{"type":382,"value":918},{"type":373,"tag":421,"props":3139,"children":3140},{"style":577},[3141],{"type":382,"value":1907},{"type":373,"tag":421,"props":3143,"children":3144},{"style":618},[3145],{"type":382,"value":1053},{"type":373,"tag":421,"props":3147,"children":3148},{"style":910},[3149],{"type":382,"value":2003},{"type":373,"tag":421,"props":3151,"children":3152},{"style":624},[3153],{"type":382,"value":918},{"type":373,"tag":421,"props":3155,"children":3156},{"style":577},[3157],{"type":382,"value":2012},{"type":373,"tag":421,"props":3159,"children":3160},{"style":618},[3161],{"type":382,"value":2017},{"type":373,"tag":421,"props":3163,"children":3164},{"style":624},[3165],{"type":382,"value":918},{"type":373,"tag":421,"props":3167,"children":3168},{"style":577},[3169],{"type":382,"value":1686},{"type":373,"tag":421,"props":3171,"children":3172},{"style":618},[3173],{"type":382,"value":2030},{"type":373,"tag":421,"props":3175,"children":3176},{"style":577},[3177],{"type":382,"value":2035},{"type":373,"tag":421,"props":3179,"children":3180},{"style":618},[3181],{"type":382,"value":2040},{"type":373,"tag":421,"props":3183,"children":3185},{"class":423,"line":3184},57,[3186,3190,3194,3198,3202,3206],{"type":373,"tag":421,"props":3187,"children":3188},{"style":624},[3189],{"type":382,"value":1080},{"type":373,"tag":421,"props":3191,"children":3192},{"style":798},[3193],{"type":382,"value":2052},{"type":373,"tag":421,"props":3195,"children":3196},{"style":624},[3197],{"type":382,"value":806},{"type":373,"tag":421,"props":3199,"children":3200},{"style":624},[3201],{"type":382,"value":1094},{"type":373,"tag":421,"props":3203,"children":3204},{"style":577},[3205],{"type":382,"value":1672},{"type":373,"tag":421,"props":3207,"children":3208},{"style":618},[3209],{"type":382,"value":2069},{"type":373,"tag":421,"props":3211,"children":3213},{"class":423,"line":3212},58,[3214,3218,3222,3226,3230,3234,3238,3242,3246,3250,3254,3258],{"type":373,"tag":421,"props":3215,"children":3216},{"style":624},[3217],{"type":382,"value":1080},{"type":373,"tag":421,"props":3219,"children":3220},{"style":798},[3221],{"type":382,"value":1085},{"type":373,"tag":421,"props":3223,"children":3224},{"style":624},[3225],{"type":382,"value":806},{"type":373,"tag":421,"props":3227,"children":3228},{"style":624},[3229],{"type":382,"value":1094},{"type":373,"tag":421,"props":3231,"children":3232},{"style":577},[3233],{"type":382,"value":1031},{"type":373,"tag":421,"props":3235,"children":3236},{"style":618},[3237],{"type":382,"value":2631},{"type":373,"tag":421,"props":3239,"children":3240},{"style":577},[3241],{"type":382,"value":2636},{"type":373,"tag":421,"props":3243,"children":3244},{"style":618},[3245],{"type":382,"value":2095},{"type":373,"tag":421,"props":3247,"children":3248},{"style":577},[3249],{"type":382,"value":1104},{"type":373,"tag":421,"props":3251,"children":3252},{"style":618},[3253],{"type":382,"value":907},{"type":373,"tag":421,"props":3255,"children":3256},{"style":583},[3257],{"type":382,"value":2653},{"type":373,"tag":421,"props":3259,"children":3260},{"style":618},[3261],{"type":382,"value":2658},{"type":373,"tag":421,"props":3263,"children":3265},{"class":423,"line":3264},59,[3266],{"type":373,"tag":421,"props":3267,"children":3268},{"style":609},[3269],{"type":382,"value":3270},"  // The old secret keeps signing for 24 hours, so the customer can switch without downtime.\n",{"type":373,"tag":421,"props":3272,"children":3274},{"class":423,"line":3273},60,[3275,3279,3284,3289,3293,3298],{"type":373,"tag":421,"props":3276,"children":3277},{"style":624},[3278],{"type":382,"value":1170},{"type":373,"tag":421,"props":3280,"children":3281},{"style":618},[3282],{"type":382,"value":3283}," { secret: ",{"type":373,"tag":421,"props":3285,"children":3286},{"style":624},[3287],{"type":382,"value":3288},"await",{"type":373,"tag":421,"props":3290,"children":3291},{"style":618},[3292],{"type":382,"value":1099},{"type":373,"tag":421,"props":3294,"children":3295},{"style":577},[3296],{"type":382,"value":3297},"rotateSecret",{"type":373,"tag":421,"props":3299,"children":3300},{"style":618},[3301],{"type":382,"value":3302},"(endpoint.id) };\n",{"type":373,"tag":421,"props":3304,"children":3306},{"class":423,"line":3305},61,[3307],{"type":373,"tag":421,"props":3308,"children":3309},{"style":618},[3310],{"type":382,"value":993},{"type":373,"tag":495,"props":3312,"children":3314},{"id":3313},"_3-the-add-endpoint-form",[3315],{"type":382,"value":3316},"3. The add-endpoint form",{"type":373,"tag":374,"props":3318,"children":3319},{},[3320],{"type":382,"value":3321},"A small client component posts to the server action and shows the signing secret exactly once.",{"type":373,"tag":412,"props":3323,"children":3327},{"className":3324,"code":3325,"language":3326,"meta":345,"style":345},"language-tsx shiki shiki-themes github-dark","// app/settings/webhooks/add-endpoint.tsx\n\"use client\";\n\nimport { useActionState } from \"react\";\nimport { addEndpoint, type AddEndpointState } from \"./actions\";\n\nexport function AddEndpointForm({ eventTypes }: { eventTypes: { name: string; description?: string }[] }) {\n  const [state, action, pending] = useActionState\u003CAddEndpointState, FormData>(addEndpoint, {});\n\n  return (\n    \u003Cform action={action}>\n      \u003Clabel>\n        Endpoint URL\n        \u003Cinput name=\"url\" type=\"url\" placeholder=\"https://example.com/webhooks\" required />\n      \u003C/label>\n      \u003Cfieldset>\n        \u003Clegend>Events\u003C/legend>\n        {eventTypes.map((t) => (\n          \u003Clabel key={t.name}>\n            \u003Cinput type=\"checkbox\" name=\"eventTypes\" value={t.name} defaultChecked /> {t.name}\n            {t.description ? ` (${t.description})` : null}\n          \u003C/label>\n        ))}\n      \u003C/fieldset>\n      \u003Cbutton disabled={pending}>{pending ? \"Adding...\" : \"Add endpoint\"}\u003C/button>\n      {state.error ? \u003Cp role=\"alert\">{state.error}\u003C/p> : null}\n      {state.secret ? (\n        \u003Cp>\n          Signing secret (copy it now, it is shown once): \u003Ccode>{state.secret}\u003C/code>\n        \u003C/p>\n      ) : null}\n    \u003C/form>\n  );\n}\n","tsx",[3328],{"type":373,"tag":385,"props":3329,"children":3330},{"__ignoreMap":345},[3331,3339,3351,3358,3383,3418,3425,3510,3581,3588,3600,3627,3645,3653,3715,3731,3747,3772,3807,3833,3894,3943,3959,3967,3982,4039,4100,4116,4131,4156,4172,4192,4208,4216],{"type":373,"tag":421,"props":3332,"children":3333},{"class":423,"line":424},[3334],{"type":373,"tag":421,"props":3335,"children":3336},{"style":609},[3337],{"type":382,"value":3338},"// app/settings/webhooks/add-endpoint.tsx\n",{"type":373,"tag":421,"props":3340,"children":3341},{"class":423,"line":433},[3342,3347],{"type":373,"tag":421,"props":3343,"children":3344},{"style":583},[3345],{"type":382,"value":3346},"\"use client\"",{"type":373,"tag":421,"props":3348,"children":3349},{"style":618},[3350],{"type":382,"value":747},{"type":373,"tag":421,"props":3352,"children":3353},{"class":423,"line":442},[3354],{"type":373,"tag":421,"props":3355,"children":3356},{"emptyLinePlaceholder":779},[3357],{"type":382,"value":782},{"type":373,"tag":421,"props":3359,"children":3360},{"class":423,"line":451},[3361,3365,3370,3374,3379],{"type":373,"tag":421,"props":3362,"children":3363},{"style":624},[3364],{"type":382,"value":737},{"type":373,"tag":421,"props":3366,"children":3367},{"style":618},[3368],{"type":382,"value":3369}," { useActionState } ",{"type":373,"tag":421,"props":3371,"children":3372},{"style":624},[3373],{"type":382,"value":764},{"type":373,"tag":421,"props":3375,"children":3376},{"style":583},[3377],{"type":382,"value":3378}," \"react\"",{"type":373,"tag":421,"props":3380,"children":3381},{"style":618},[3382],{"type":382,"value":747},{"type":373,"tag":421,"props":3384,"children":3385},{"class":423,"line":460},[3386,3390,3395,3400,3405,3409,3414],{"type":373,"tag":421,"props":3387,"children":3388},{"style":624},[3389],{"type":382,"value":737},{"type":373,"tag":421,"props":3391,"children":3392},{"style":618},[3393],{"type":382,"value":3394}," { addEndpoint, ",{"type":373,"tag":421,"props":3396,"children":3397},{"style":624},[3398],{"type":382,"value":3399},"type",{"type":373,"tag":421,"props":3401,"children":3402},{"style":618},[3403],{"type":382,"value":3404}," AddEndpointState } ",{"type":373,"tag":421,"props":3406,"children":3407},{"style":624},[3408],{"type":382,"value":764},{"type":373,"tag":421,"props":3410,"children":3411},{"style":583},[3412],{"type":382,"value":3413}," \"./actions\"",{"type":373,"tag":421,"props":3415,"children":3416},{"style":618},[3417],{"type":382,"value":747},{"type":373,"tag":421,"props":3419,"children":3420},{"class":423,"line":469},[3421],{"type":373,"tag":421,"props":3422,"children":3423},{"emptyLinePlaceholder":779},[3424],{"type":382,"value":782},{"type":373,"tag":421,"props":3426,"children":3427},{"class":423,"line":478},[3428,3432,3436,3441,3446,3451,3456,3460,3464,3468,3472,3476,3480,3484,3488,3492,3497,3501,3505],{"type":373,"tag":421,"props":3429,"children":3430},{"style":624},[3431],{"type":382,"value":790},{"type":373,"tag":421,"props":3433,"children":3434},{"style":624},[3435],{"type":382,"value":897},{"type":373,"tag":421,"props":3437,"children":3438},{"style":577},[3439],{"type":382,"value":3440}," AddEndpointForm",{"type":373,"tag":421,"props":3442,"children":3443},{"style":618},[3444],{"type":382,"value":3445},"({ ",{"type":373,"tag":421,"props":3447,"children":3448},{"style":910},[3449],{"type":382,"value":3450},"eventTypes",{"type":373,"tag":421,"props":3452,"children":3453},{"style":618},[3454],{"type":382,"value":3455}," }",{"type":373,"tag":421,"props":3457,"children":3458},{"style":624},[3459],{"type":382,"value":918},{"type":373,"tag":421,"props":3461,"children":3462},{"style":618},[3463],{"type":382,"value":923},{"type":373,"tag":421,"props":3465,"children":3466},{"style":910},[3467],{"type":382,"value":3450},{"type":373,"tag":421,"props":3469,"children":3470},{"style":624},[3471],{"type":382,"value":918},{"type":373,"tag":421,"props":3473,"children":3474},{"style":618},[3475],{"type":382,"value":923},{"type":373,"tag":421,"props":3477,"children":3478},{"style":910},[3479],{"type":382,"value":947},{"type":373,"tag":421,"props":3481,"children":3482},{"style":624},[3483],{"type":382,"value":918},{"type":373,"tag":421,"props":3485,"children":3486},{"style":798},[3487],{"type":382,"value":937},{"type":373,"tag":421,"props":3489,"children":3490},{"style":618},[3491],{"type":382,"value":942},{"type":373,"tag":421,"props":3493,"children":3494},{"style":910},[3495],{"type":382,"value":3496},"description",{"type":373,"tag":421,"props":3498,"children":3499},{"style":624},[3500],{"type":382,"value":1925},{"type":373,"tag":421,"props":3502,"children":3503},{"style":798},[3504],{"type":382,"value":937},{"type":373,"tag":421,"props":3506,"children":3507},{"style":618},[3508],{"type":382,"value":3509}," }[] }) {\n",{"type":373,"tag":421,"props":3511,"children":3512},{"class":423,"line":487},[3513,3517,3522,3527,3531,3536,3540,3545,3550,3554,3559,3563,3567,3571,3576],{"type":373,"tag":421,"props":3514,"children":3515},{"style":624},[3516],{"type":382,"value":1080},{"type":373,"tag":421,"props":3518,"children":3519},{"style":618},[3520],{"type":382,"value":3521}," [",{"type":373,"tag":421,"props":3523,"children":3524},{"style":798},[3525],{"type":382,"value":3526},"state",{"type":373,"tag":421,"props":3528,"children":3529},{"style":618},[3530],{"type":382,"value":1053},{"type":373,"tag":421,"props":3532,"children":3533},{"style":798},[3534],{"type":382,"value":3535},"action",{"type":373,"tag":421,"props":3537,"children":3538},{"style":618},[3539],{"type":382,"value":1053},{"type":373,"tag":421,"props":3541,"children":3542},{"style":798},[3543],{"type":382,"value":3544},"pending",{"type":373,"tag":421,"props":3546,"children":3547},{"style":618},[3548],{"type":382,"value":3549},"] ",{"type":373,"tag":421,"props":3551,"children":3552},{"style":624},[3553],{"type":382,"value":627},{"type":373,"tag":421,"props":3555,"children":3556},{"style":577},[3557],{"type":382,"value":3558}," useActionState",{"type":373,"tag":421,"props":3560,"children":3561},{"style":618},[3562],{"type":382,"value":2030},{"type":373,"tag":421,"props":3564,"children":3565},{"style":577},[3566],{"type":382,"value":2035},{"type":373,"tag":421,"props":3568,"children":3569},{"style":618},[3570],{"type":382,"value":1053},{"type":373,"tag":421,"props":3572,"children":3573},{"style":577},[3574],{"type":382,"value":3575},"FormData",{"type":373,"tag":421,"props":3577,"children":3578},{"style":618},[3579],{"type":382,"value":3580},">(addEndpoint, {});\n",{"type":373,"tag":421,"props":3582,"children":3583},{"class":423,"line":865},[3584],{"type":373,"tag":421,"props":3585,"children":3586},{"emptyLinePlaceholder":779},[3587],{"type":382,"value":782},{"type":373,"tag":421,"props":3589,"children":3590},{"class":423,"line":873},[3591,3595],{"type":373,"tag":421,"props":3592,"children":3593},{"style":624},[3594],{"type":382,"value":1170},{"type":373,"tag":421,"props":3596,"children":3597},{"style":618},[3598],{"type":382,"value":3599}," (\n",{"type":373,"tag":421,"props":3601,"children":3602},{"class":423,"line":882},[3603,3608,3613,3618,3622],{"type":373,"tag":421,"props":3604,"children":3605},{"style":618},[3606],{"type":382,"value":3607},"    \u003C",{"type":373,"tag":421,"props":3609,"children":3611},{"style":3610},"--shiki-default:#85E89D",[3612],{"type":382,"value":2003},{"type":373,"tag":421,"props":3614,"children":3615},{"style":577},[3616],{"type":382,"value":3617}," action",{"type":373,"tag":421,"props":3619,"children":3620},{"style":624},[3621],{"type":382,"value":627},{"type":373,"tag":421,"props":3623,"children":3624},{"style":618},[3625],{"type":382,"value":3626},"{action}>\n",{"type":373,"tag":421,"props":3628,"children":3629},{"class":423,"line":963},[3630,3635,3640],{"type":373,"tag":421,"props":3631,"children":3632},{"style":618},[3633],{"type":382,"value":3634},"      \u003C",{"type":373,"tag":421,"props":3636,"children":3637},{"style":3610},[3638],{"type":382,"value":3639},"label",{"type":373,"tag":421,"props":3641,"children":3642},{"style":618},[3643],{"type":382,"value":3644},">\n",{"type":373,"tag":421,"props":3646,"children":3647},{"class":423,"line":987},[3648],{"type":373,"tag":421,"props":3649,"children":3650},{"style":618},[3651],{"type":382,"value":3652},"        Endpoint URL\n",{"type":373,"tag":421,"props":3654,"children":3655},{"class":423,"line":996},[3656,3661,3666,3671,3675,3679,3683,3687,3691,3696,3700,3705,3710],{"type":373,"tag":421,"props":3657,"children":3658},{"style":618},[3659],{"type":382,"value":3660},"        \u003C",{"type":373,"tag":421,"props":3662,"children":3663},{"style":3610},[3664],{"type":382,"value":3665},"input",{"type":373,"tag":421,"props":3667,"children":3668},{"style":577},[3669],{"type":382,"value":3670}," name",{"type":373,"tag":421,"props":3672,"children":3673},{"style":624},[3674],{"type":382,"value":627},{"type":373,"tag":421,"props":3676,"children":3677},{"style":583},[3678],{"type":382,"value":2108},{"type":373,"tag":421,"props":3680,"children":3681},{"style":577},[3682],{"type":382,"value":1902},{"type":373,"tag":421,"props":3684,"children":3685},{"style":624},[3686],{"type":382,"value":627},{"type":373,"tag":421,"props":3688,"children":3689},{"style":583},[3690],{"type":382,"value":2108},{"type":373,"tag":421,"props":3692,"children":3693},{"style":577},[3694],{"type":382,"value":3695}," placeholder",{"type":373,"tag":421,"props":3697,"children":3698},{"style":624},[3699],{"type":382,"value":627},{"type":373,"tag":421,"props":3701,"children":3702},{"style":583},[3703],{"type":382,"value":3704},"\"https://example.com/webhooks\"",{"type":373,"tag":421,"props":3706,"children":3707},{"style":577},[3708],{"type":382,"value":3709}," required",{"type":373,"tag":421,"props":3711,"children":3712},{"style":618},[3713],{"type":382,"value":3714}," />\n",{"type":373,"tag":421,"props":3716,"children":3717},{"class":423,"line":1004},[3718,3723,3727],{"type":373,"tag":421,"props":3719,"children":3720},{"style":618},[3721],{"type":382,"value":3722},"      \u003C/",{"type":373,"tag":421,"props":3724,"children":3725},{"style":3610},[3726],{"type":382,"value":3639},{"type":373,"tag":421,"props":3728,"children":3729},{"style":618},[3730],{"type":382,"value":3644},{"type":373,"tag":421,"props":3732,"children":3733},{"class":423,"line":1013},[3734,3738,3743],{"type":373,"tag":421,"props":3735,"children":3736},{"style":618},[3737],{"type":382,"value":3634},{"type":373,"tag":421,"props":3739,"children":3740},{"style":3610},[3741],{"type":382,"value":3742},"fieldset",{"type":373,"tag":421,"props":3744,"children":3745},{"style":618},[3746],{"type":382,"value":3644},{"type":373,"tag":421,"props":3748,"children":3749},{"class":423,"line":1074},[3750,3754,3759,3764,3768],{"type":373,"tag":421,"props":3751,"children":3752},{"style":618},[3753],{"type":382,"value":3660},{"type":373,"tag":421,"props":3755,"children":3756},{"style":3610},[3757],{"type":382,"value":3758},"legend",{"type":373,"tag":421,"props":3760,"children":3761},{"style":618},[3762],{"type":382,"value":3763},">Events\u003C/",{"type":373,"tag":421,"props":3765,"children":3766},{"style":3610},[3767],{"type":382,"value":3758},{"type":373,"tag":421,"props":3769,"children":3770},{"style":618},[3771],{"type":382,"value":3644},{"type":373,"tag":421,"props":3773,"children":3774},{"class":423,"line":1112},[3775,3780,3784,3789,3794,3798,3803],{"type":373,"tag":421,"props":3776,"children":3777},{"style":618},[3778],{"type":382,"value":3779},"        {eventTypes.",{"type":373,"tag":421,"props":3781,"children":3782},{"style":577},[3783],{"type":382,"value":2179},{"type":373,"tag":421,"props":3785,"children":3786},{"style":618},[3787],{"type":382,"value":3788},"((",{"type":373,"tag":421,"props":3790,"children":3791},{"style":910},[3792],{"type":382,"value":3793},"t",{"type":373,"tag":421,"props":3795,"children":3796},{"style":618},[3797],{"type":382,"value":1350},{"type":373,"tag":421,"props":3799,"children":3800},{"style":624},[3801],{"type":382,"value":3802},"=>",{"type":373,"tag":421,"props":3804,"children":3805},{"style":618},[3806],{"type":382,"value":3599},{"type":373,"tag":421,"props":3808,"children":3809},{"class":423,"line":1164},[3810,3815,3819,3824,3828],{"type":373,"tag":421,"props":3811,"children":3812},{"style":618},[3813],{"type":382,"value":3814},"          \u003C",{"type":373,"tag":421,"props":3816,"children":3817},{"style":3610},[3818],{"type":382,"value":3639},{"type":373,"tag":421,"props":3820,"children":3821},{"style":577},[3822],{"type":382,"value":3823}," key",{"type":373,"tag":421,"props":3825,"children":3826},{"style":624},[3827],{"type":382,"value":627},{"type":373,"tag":421,"props":3829,"children":3830},{"style":618},[3831],{"type":382,"value":3832},"{t.name}>\n",{"type":373,"tag":421,"props":3834,"children":3835},{"class":423,"line":1178},[3836,3841,3845,3849,3853,3858,3862,3866,3870,3875,3879,3884,3889],{"type":373,"tag":421,"props":3837,"children":3838},{"style":618},[3839],{"type":382,"value":3840},"            \u003C",{"type":373,"tag":421,"props":3842,"children":3843},{"style":3610},[3844],{"type":382,"value":3665},{"type":373,"tag":421,"props":3846,"children":3847},{"style":577},[3848],{"type":382,"value":1902},{"type":373,"tag":421,"props":3850,"children":3851},{"style":624},[3852],{"type":382,"value":627},{"type":373,"tag":421,"props":3854,"children":3855},{"style":583},[3856],{"type":382,"value":3857},"\"checkbox\"",{"type":373,"tag":421,"props":3859,"children":3860},{"style":577},[3861],{"type":382,"value":3670},{"type":373,"tag":421,"props":3863,"children":3864},{"style":624},[3865],{"type":382,"value":627},{"type":373,"tag":421,"props":3867,"children":3868},{"style":583},[3869],{"type":382,"value":2170},{"type":373,"tag":421,"props":3871,"children":3872},{"style":577},[3873],{"type":382,"value":3874}," value",{"type":373,"tag":421,"props":3876,"children":3877},{"style":624},[3878],{"type":382,"value":627},{"type":373,"tag":421,"props":3880,"children":3881},{"style":618},[3882],{"type":382,"value":3883},"{t.name} ",{"type":373,"tag":421,"props":3885,"children":3886},{"style":577},[3887],{"type":382,"value":3888},"defaultChecked",{"type":373,"tag":421,"props":3890,"children":3891},{"style":618},[3892],{"type":382,"value":3893}," /> {t.name}\n",{"type":373,"tag":421,"props":3895,"children":3896},{"class":423,"line":1186},[3897,3902,3907,3912,3916,3921,3925,3930,3935,3939],{"type":373,"tag":421,"props":3898,"children":3899},{"style":618},[3900],{"type":382,"value":3901},"            {t.description ",{"type":373,"tag":421,"props":3903,"children":3904},{"style":624},[3905],{"type":382,"value":3906},"?",{"type":373,"tag":421,"props":3908,"children":3909},{"style":583},[3910],{"type":382,"value":3911}," ` (${",{"type":373,"tag":421,"props":3913,"children":3914},{"style":618},[3915],{"type":382,"value":3793},{"type":373,"tag":421,"props":3917,"children":3918},{"style":583},[3919],{"type":382,"value":3920},".",{"type":373,"tag":421,"props":3922,"children":3923},{"style":618},[3924],{"type":382,"value":3496},{"type":373,"tag":421,"props":3926,"children":3927},{"style":583},[3928],{"type":382,"value":3929},"})`",{"type":373,"tag":421,"props":3931,"children":3932},{"style":624},[3933],{"type":382,"value":3934}," :",{"type":373,"tag":421,"props":3936,"children":3937},{"style":798},[3938],{"type":382,"value":1605},{"type":373,"tag":421,"props":3940,"children":3941},{"style":618},[3942],{"type":382,"value":993},{"type":373,"tag":421,"props":3944,"children":3945},{"class":423,"line":1194},[3946,3951,3955],{"type":373,"tag":421,"props":3947,"children":3948},{"style":618},[3949],{"type":382,"value":3950},"          \u003C/",{"type":373,"tag":421,"props":3952,"children":3953},{"style":3610},[3954],{"type":382,"value":3639},{"type":373,"tag":421,"props":3956,"children":3957},{"style":618},[3958],{"type":382,"value":3644},{"type":373,"tag":421,"props":3960,"children":3961},{"class":423,"line":1203},[3962],{"type":373,"tag":421,"props":3963,"children":3964},{"style":618},[3965],{"type":382,"value":3966},"        ))}\n",{"type":373,"tag":421,"props":3968,"children":3969},{"class":423,"line":1244},[3970,3974,3978],{"type":373,"tag":421,"props":3971,"children":3972},{"style":618},[3973],{"type":382,"value":3722},{"type":373,"tag":421,"props":3975,"children":3976},{"style":3610},[3977],{"type":382,"value":3742},{"type":373,"tag":421,"props":3979,"children":3980},{"style":618},[3981],{"type":382,"value":3644},{"type":373,"tag":421,"props":3983,"children":3984},{"class":423,"line":1258},[3985,3989,3994,3999,4003,4008,4012,4017,4021,4026,4031,4035],{"type":373,"tag":421,"props":3986,"children":3987},{"style":618},[3988],{"type":382,"value":3634},{"type":373,"tag":421,"props":3990,"children":3991},{"style":3610},[3992],{"type":382,"value":3993},"button",{"type":373,"tag":421,"props":3995,"children":3996},{"style":577},[3997],{"type":382,"value":3998}," disabled",{"type":373,"tag":421,"props":4000,"children":4001},{"style":624},[4002],{"type":382,"value":627},{"type":373,"tag":421,"props":4004,"children":4005},{"style":618},[4006],{"type":382,"value":4007},"{pending}>{pending ",{"type":373,"tag":421,"props":4009,"children":4010},{"style":624},[4011],{"type":382,"value":3906},{"type":373,"tag":421,"props":4013,"children":4014},{"style":583},[4015],{"type":382,"value":4016}," \"Adding...\"",{"type":373,"tag":421,"props":4018,"children":4019},{"style":624},[4020],{"type":382,"value":3934},{"type":373,"tag":421,"props":4022,"children":4023},{"style":583},[4024],{"type":382,"value":4025}," \"Add endpoint\"",{"type":373,"tag":421,"props":4027,"children":4028},{"style":618},[4029],{"type":382,"value":4030},"}\u003C/",{"type":373,"tag":421,"props":4032,"children":4033},{"style":3610},[4034],{"type":382,"value":3993},{"type":373,"tag":421,"props":4036,"children":4037},{"style":618},[4038],{"type":382,"value":3644},{"type":373,"tag":421,"props":4040,"children":4041},{"class":423,"line":1285},[4042,4047,4051,4056,4060,4065,4069,4074,4079,4083,4088,4092,4096],{"type":373,"tag":421,"props":4043,"children":4044},{"style":618},[4045],{"type":382,"value":4046},"      {state.error ",{"type":373,"tag":421,"props":4048,"children":4049},{"style":624},[4050],{"type":382,"value":3906},{"type":373,"tag":421,"props":4052,"children":4053},{"style":618},[4054],{"type":382,"value":4055}," \u003C",{"type":373,"tag":421,"props":4057,"children":4058},{"style":3610},[4059],{"type":382,"value":374},{"type":373,"tag":421,"props":4061,"children":4062},{"style":577},[4063],{"type":382,"value":4064}," role",{"type":373,"tag":421,"props":4066,"children":4067},{"style":624},[4068],{"type":382,"value":627},{"type":373,"tag":421,"props":4070,"children":4071},{"style":583},[4072],{"type":382,"value":4073},"\"alert\"",{"type":373,"tag":421,"props":4075,"children":4076},{"style":618},[4077],{"type":382,"value":4078},">{state.error}\u003C/",{"type":373,"tag":421,"props":4080,"children":4081},{"style":3610},[4082],{"type":382,"value":374},{"type":373,"tag":421,"props":4084,"children":4085},{"style":618},[4086],{"type":382,"value":4087},"> ",{"type":373,"tag":421,"props":4089,"children":4090},{"style":624},[4091],{"type":382,"value":918},{"type":373,"tag":421,"props":4093,"children":4094},{"style":798},[4095],{"type":382,"value":1605},{"type":373,"tag":421,"props":4097,"children":4098},{"style":618},[4099],{"type":382,"value":993},{"type":373,"tag":421,"props":4101,"children":4102},{"class":423,"line":1304},[4103,4108,4112],{"type":373,"tag":421,"props":4104,"children":4105},{"style":618},[4106],{"type":382,"value":4107},"      {state.secret ",{"type":373,"tag":421,"props":4109,"children":4110},{"style":624},[4111],{"type":382,"value":3906},{"type":373,"tag":421,"props":4113,"children":4114},{"style":618},[4115],{"type":382,"value":3599},{"type":373,"tag":421,"props":4117,"children":4118},{"class":423,"line":1363},[4119,4123,4127],{"type":373,"tag":421,"props":4120,"children":4121},{"style":618},[4122],{"type":382,"value":3660},{"type":373,"tag":421,"props":4124,"children":4125},{"style":3610},[4126],{"type":382,"value":374},{"type":373,"tag":421,"props":4128,"children":4129},{"style":618},[4130],{"type":382,"value":3644},{"type":373,"tag":421,"props":4132,"children":4133},{"class":423,"line":1377},[4134,4139,4143,4148,4152],{"type":373,"tag":421,"props":4135,"children":4136},{"style":618},[4137],{"type":382,"value":4138},"          Signing secret (copy it now, it is shown once): \u003C",{"type":373,"tag":421,"props":4140,"children":4141},{"style":3610},[4142],{"type":382,"value":385},{"type":373,"tag":421,"props":4144,"children":4145},{"style":618},[4146],{"type":382,"value":4147},">{state.secret}\u003C/",{"type":373,"tag":421,"props":4149,"children":4150},{"style":3610},[4151],{"type":382,"value":385},{"type":373,"tag":421,"props":4153,"children":4154},{"style":618},[4155],{"type":382,"value":3644},{"type":373,"tag":421,"props":4157,"children":4158},{"class":423,"line":1386},[4159,4164,4168],{"type":373,"tag":421,"props":4160,"children":4161},{"style":618},[4162],{"type":382,"value":4163},"        \u003C/",{"type":373,"tag":421,"props":4165,"children":4166},{"style":3610},[4167],{"type":382,"value":374},{"type":373,"tag":421,"props":4169,"children":4170},{"style":618},[4171],{"type":382,"value":3644},{"type":373,"tag":421,"props":4173,"children":4174},{"class":423,"line":1394},[4175,4180,4184,4188],{"type":373,"tag":421,"props":4176,"children":4177},{"style":618},[4178],{"type":382,"value":4179},"      ) ",{"type":373,"tag":421,"props":4181,"children":4182},{"style":624},[4183],{"type":382,"value":918},{"type":373,"tag":421,"props":4185,"children":4186},{"style":798},[4187],{"type":382,"value":1605},{"type":373,"tag":421,"props":4189,"children":4190},{"style":618},[4191],{"type":382,"value":993},{"type":373,"tag":421,"props":4193,"children":4194},{"class":423,"line":1402},[4195,4200,4204],{"type":373,"tag":421,"props":4196,"children":4197},{"style":618},[4198],{"type":382,"value":4199},"    \u003C/",{"type":373,"tag":421,"props":4201,"children":4202},{"style":3610},[4203],{"type":382,"value":2003},{"type":373,"tag":421,"props":4205,"children":4206},{"style":618},[4207],{"type":382,"value":3644},{"type":373,"tag":421,"props":4209,"children":4210},{"class":423,"line":1411},[4211],{"type":373,"tag":421,"props":4212,"children":4213},{"style":618},[4214],{"type":382,"value":4215},"  );\n",{"type":373,"tag":421,"props":4217,"children":4218},{"class":423,"line":1504},[4219],{"type":373,"tag":421,"props":4220,"children":4221},{"style":618},[4222],{"type":382,"value":993},{"type":373,"tag":495,"props":4224,"children":4226},{"id":4225},"_4-the-settings-page",[4227],{"type":382,"value":4228},"4. The settings page",{"type":373,"tag":374,"props":4230,"children":4231},{},[4232],{"type":382,"value":4233},"A server component lists the org's endpoints with their state and 24-hour failure count, plus the latest deliveries for each, with buttons to retry one delivery or re-send everything that failed.",{"type":373,"tag":412,"props":4235,"children":4237},{"className":3324,"code":4236,"language":3326,"meta":345,"style":345},"// app/settings/webhooks/page.tsx\nimport { getCurrentOrg } from \"@/lib/auth\";\nimport { listEndpoints, relay } from \"@/lib/webhooks\";\nimport { deleteEndpoint, resendFailed, retryDelivery } from \"./actions\";\nimport { AddEndpointForm } from \"./add-endpoint\";\n\nexport const dynamic = \"force-dynamic\";\n\nexport default async function WebhooksSettingsPage() {\n  const org = await getCurrentOrg();\n  const [eventTypes, endpoints] = await Promise.all([\n    relay.outbound.eventTypes.list(),\n    listEndpoints(org.id),\n  ]);\n  const deliveries = await Promise.all(\n    endpoints.map((e) => relay.outbound.endpoints.deliveries(e.id, { limit: 10 })),\n  );\n\n  return (\n    \u003Cmain>\n      \u003Ch1>Webhooks\u003C/h1>\n      \u003Cp>\n        We sign every webhook with the Standard Webhooks scheme (webhook-id, webhook-timestamp,\n        webhook-signature) and retry failures for up to 48 hours.\n      \u003C/p>\n\n      \u003CAddEndpointForm eventTypes={eventTypes.filter((t) => !t.deprecated)} />\n\n      {endpoints.map((endpoint, i) => (\n        \u003Csection key={endpoint.id}>\n          \u003Ch2>{endpoint.url}\u003C/h2>\n          \u003Cp>\n            {endpoint.state} · events: {endpoint.event_types.join(\", \")} · last 24h:{\" \"}\n            {endpoint.stats?.attempts ?? 0} attempts, {endpoint.stats?.failures ?? 0} failed\n          \u003C/p>\n\n          \u003Ctable>\n            \u003Cthead>\n              \u003Ctr>\u003Cth>Event\u003C/th>\u003Cth>Message\u003C/th>\u003Cth>Last response\u003C/th>\u003Cth />\u003C/tr>\n            \u003C/thead>\n            \u003Ctbody>\n              {deliveries[i].map((d) => (\n                \u003Ctr key={d.id}>\n                  \u003Ctd>{d.event_type}\u003C/td>\n                  \u003Ctd>\u003Ccode>{d.message_id}\u003C/code>\u003C/td>\n                  \u003Ctd>{d.status_code ?? \"pending\"}\u003C/td>\n                  \u003Ctd>\n                    \u003Cform action={retryDelivery}>\n                      \u003Cinput type=\"hidden\" name=\"endpointId\" value={endpoint.id} />\n                      \u003Cinput type=\"hidden\" name=\"messageId\" value={d.message_id} />\n                      \u003Cbutton>Retry\u003C/button>\n                    \u003C/form>\n                  \u003C/td>\n                \u003C/tr>\n              ))}\n            \u003C/tbody>\n          \u003C/table>\n\n          \u003Cform action={resendFailed}>\n            \u003Cinput type=\"hidden\" name=\"endpointId\" value={endpoint.id} />\n            \u003Cbutton>Re-send failed deliveries (last 24h)\u003C/button>\n          \u003C/form>\n          \u003Cform action={deleteEndpoint}>\n            \u003Cinput type=\"hidden\" name=\"endpointId\" value={endpoint.id} />\n            \u003Cbutton>Delete endpoint\u003C/button>\n          \u003C/form>\n        \u003C/section>\n      ))}\n    \u003C/main>\n  );\n}\n",[4238],{"type":373,"tag":385,"props":4239,"children":4240},{"__ignoreMap":345},[4241,4249,4272,4296,4320,4345,4352,4381,4388,4418,4445,4499,4516,4529,4537,4574,4627,4634,4641,4652,4668,4693,4708,4716,4724,4739,4746,4802,4809,4851,4876,4900,4915,4951,4985,5000,5007,5023,5039,5126,5142,5158,5191,5216,5242,5283,5320,5335,5360,5410,5458,5482,5498,5514,5530,5538,5553,5568,5575,5599,5646,5670,5686,5711,5759,5784,5800,5816,5825,5841,5849],{"type":373,"tag":421,"props":4242,"children":4243},{"class":423,"line":424},[4244],{"type":373,"tag":421,"props":4245,"children":4246},{"style":609},[4247],{"type":382,"value":4248},"// app/settings/webhooks/page.tsx\n",{"type":373,"tag":421,"props":4250,"children":4251},{"class":423,"line":433},[4252,4256,4260,4264,4268],{"type":373,"tag":421,"props":4253,"children":4254},{"style":624},[4255],{"type":382,"value":737},{"type":373,"tag":421,"props":4257,"children":4258},{"style":618},[4259],{"type":382,"value":1845},{"type":373,"tag":421,"props":4261,"children":4262},{"style":624},[4263],{"type":382,"value":764},{"type":373,"tag":421,"props":4265,"children":4266},{"style":583},[4267],{"type":382,"value":1854},{"type":373,"tag":421,"props":4269,"children":4270},{"style":618},[4271],{"type":382,"value":747},{"type":373,"tag":421,"props":4273,"children":4274},{"class":423,"line":442},[4275,4279,4284,4288,4292],{"type":373,"tag":421,"props":4276,"children":4277},{"style":624},[4278],{"type":382,"value":737},{"type":373,"tag":421,"props":4280,"children":4281},{"style":618},[4282],{"type":382,"value":4283}," { listEndpoints, relay } ",{"type":373,"tag":421,"props":4285,"children":4286},{"style":624},[4287],{"type":382,"value":764},{"type":373,"tag":421,"props":4289,"children":4290},{"style":583},[4291],{"type":382,"value":1879},{"type":373,"tag":421,"props":4293,"children":4294},{"style":618},[4295],{"type":382,"value":747},{"type":373,"tag":421,"props":4297,"children":4298},{"class":423,"line":451},[4299,4303,4308,4312,4316],{"type":373,"tag":421,"props":4300,"children":4301},{"style":624},[4302],{"type":382,"value":737},{"type":373,"tag":421,"props":4304,"children":4305},{"style":618},[4306],{"type":382,"value":4307}," { deleteEndpoint, resendFailed, retryDelivery } ",{"type":373,"tag":421,"props":4309,"children":4310},{"style":624},[4311],{"type":382,"value":764},{"type":373,"tag":421,"props":4313,"children":4314},{"style":583},[4315],{"type":382,"value":3413},{"type":373,"tag":421,"props":4317,"children":4318},{"style":618},[4319],{"type":382,"value":747},{"type":373,"tag":421,"props":4321,"children":4322},{"class":423,"line":460},[4323,4327,4332,4336,4341],{"type":373,"tag":421,"props":4324,"children":4325},{"style":624},[4326],{"type":382,"value":737},{"type":373,"tag":421,"props":4328,"children":4329},{"style":618},[4330],{"type":382,"value":4331}," { AddEndpointForm } ",{"type":373,"tag":421,"props":4333,"children":4334},{"style":624},[4335],{"type":382,"value":764},{"type":373,"tag":421,"props":4337,"children":4338},{"style":583},[4339],{"type":382,"value":4340}," \"./add-endpoint\"",{"type":373,"tag":421,"props":4342,"children":4343},{"style":618},[4344],{"type":382,"value":747},{"type":373,"tag":421,"props":4346,"children":4347},{"class":423,"line":469},[4348],{"type":373,"tag":421,"props":4349,"children":4350},{"emptyLinePlaceholder":779},[4351],{"type":382,"value":782},{"type":373,"tag":421,"props":4353,"children":4354},{"class":423,"line":478},[4355,4359,4363,4368,4372,4377],{"type":373,"tag":421,"props":4356,"children":4357},{"style":624},[4358],{"type":382,"value":790},{"type":373,"tag":421,"props":4360,"children":4361},{"style":624},[4362],{"type":382,"value":795},{"type":373,"tag":421,"props":4364,"children":4365},{"style":798},[4366],{"type":382,"value":4367}," dynamic",{"type":373,"tag":421,"props":4369,"children":4370},{"style":624},[4371],{"type":382,"value":806},{"type":373,"tag":421,"props":4373,"children":4374},{"style":583},[4375],{"type":382,"value":4376}," \"force-dynamic\"",{"type":373,"tag":421,"props":4378,"children":4379},{"style":618},[4380],{"type":382,"value":747},{"type":373,"tag":421,"props":4382,"children":4383},{"class":423,"line":487},[4384],{"type":373,"tag":421,"props":4385,"children":4386},{"emptyLinePlaceholder":779},[4387],{"type":382,"value":782},{"type":373,"tag":421,"props":4389,"children":4390},{"class":423,"line":865},[4391,4395,4400,4404,4408,4413],{"type":373,"tag":421,"props":4392,"children":4393},{"style":624},[4394],{"type":382,"value":790},{"type":373,"tag":421,"props":4396,"children":4397},{"style":624},[4398],{"type":382,"value":4399}," default",{"type":373,"tag":421,"props":4401,"children":4402},{"style":624},[4403],{"type":382,"value":892},{"type":373,"tag":421,"props":4405,"children":4406},{"style":624},[4407],{"type":382,"value":897},{"type":373,"tag":421,"props":4409,"children":4410},{"style":577},[4411],{"type":382,"value":4412}," WebhooksSettingsPage",{"type":373,"tag":421,"props":4414,"children":4415},{"style":618},[4416],{"type":382,"value":4417},"() {\n",{"type":373,"tag":421,"props":4419,"children":4420},{"class":423,"line":873},[4421,4425,4429,4433,4437,4441],{"type":373,"tag":421,"props":4422,"children":4423},{"style":624},[4424],{"type":382,"value":1080},{"type":373,"tag":421,"props":4426,"children":4427},{"style":798},[4428],{"type":382,"value":2052},{"type":373,"tag":421,"props":4430,"children":4431},{"style":624},[4432],{"type":382,"value":806},{"type":373,"tag":421,"props":4434,"children":4435},{"style":624},[4436],{"type":382,"value":1094},{"type":373,"tag":421,"props":4438,"children":4439},{"style":577},[4440],{"type":382,"value":1672},{"type":373,"tag":421,"props":4442,"children":4443},{"style":618},[4444],{"type":382,"value":2069},{"type":373,"tag":421,"props":4446,"children":4447},{"class":423,"line":882},[4448,4452,4456,4460,4464,4469,4473,4477,4481,4485,4489,4494],{"type":373,"tag":421,"props":4449,"children":4450},{"style":624},[4451],{"type":382,"value":1080},{"type":373,"tag":421,"props":4453,"children":4454},{"style":618},[4455],{"type":382,"value":3521},{"type":373,"tag":421,"props":4457,"children":4458},{"style":798},[4459],{"type":382,"value":3450},{"type":373,"tag":421,"props":4461,"children":4462},{"style":618},[4463],{"type":382,"value":1053},{"type":373,"tag":421,"props":4465,"children":4466},{"style":798},[4467],{"type":382,"value":4468},"endpoints",{"type":373,"tag":421,"props":4470,"children":4471},{"style":618},[4472],{"type":382,"value":3549},{"type":373,"tag":421,"props":4474,"children":4475},{"style":624},[4476],{"type":382,"value":627},{"type":373,"tag":421,"props":4478,"children":4479},{"style":624},[4480],{"type":382,"value":1094},{"type":373,"tag":421,"props":4482,"children":4483},{"style":798},[4484],{"type":382,"value":1686},{"type":373,"tag":421,"props":4486,"children":4487},{"style":618},[4488],{"type":382,"value":3920},{"type":373,"tag":421,"props":4490,"children":4491},{"style":577},[4492],{"type":382,"value":4493},"all",{"type":373,"tag":421,"props":4495,"children":4496},{"style":618},[4497],{"type":382,"value":4498},"([\n",{"type":373,"tag":421,"props":4500,"children":4501},{"class":423,"line":963},[4502,4507,4511],{"type":373,"tag":421,"props":4503,"children":4504},{"style":618},[4505],{"type":382,"value":4506},"    relay.outbound.eventTypes.",{"type":373,"tag":421,"props":4508,"children":4509},{"style":577},[4510],{"type":382,"value":1277},{"type":373,"tag":421,"props":4512,"children":4513},{"style":618},[4514],{"type":382,"value":4515},"(),\n",{"type":373,"tag":421,"props":4517,"children":4518},{"class":423,"line":987},[4519,4524],{"type":373,"tag":421,"props":4520,"children":4521},{"style":577},[4522],{"type":382,"value":4523},"    listEndpoints",{"type":373,"tag":421,"props":4525,"children":4526},{"style":618},[4527],{"type":382,"value":4528},"(org.id),\n",{"type":373,"tag":421,"props":4530,"children":4531},{"class":423,"line":996},[4532],{"type":373,"tag":421,"props":4533,"children":4534},{"style":618},[4535],{"type":382,"value":4536},"  ]);\n",{"type":373,"tag":421,"props":4538,"children":4539},{"class":423,"line":1004},[4540,4544,4549,4553,4557,4561,4565,4569],{"type":373,"tag":421,"props":4541,"children":4542},{"style":624},[4543],{"type":382,"value":1080},{"type":373,"tag":421,"props":4545,"children":4546},{"style":798},[4547],{"type":382,"value":4548}," deliveries",{"type":373,"tag":421,"props":4550,"children":4551},{"style":624},[4552],{"type":382,"value":806},{"type":373,"tag":421,"props":4554,"children":4555},{"style":624},[4556],{"type":382,"value":1094},{"type":373,"tag":421,"props":4558,"children":4559},{"style":798},[4560],{"type":382,"value":1686},{"type":373,"tag":421,"props":4562,"children":4563},{"style":618},[4564],{"type":382,"value":3920},{"type":373,"tag":421,"props":4566,"children":4567},{"style":577},[4568],{"type":382,"value":4493},{"type":373,"tag":421,"props":4570,"children":4571},{"style":618},[4572],{"type":382,"value":4573},"(\n",{"type":373,"tag":421,"props":4575,"children":4576},{"class":423,"line":1013},[4577,4582,4586,4590,4595,4599,4603,4607,4612,4617,4622],{"type":373,"tag":421,"props":4578,"children":4579},{"style":618},[4580],{"type":382,"value":4581},"    endpoints.",{"type":373,"tag":421,"props":4583,"children":4584},{"style":577},[4585],{"type":382,"value":2179},{"type":373,"tag":421,"props":4587,"children":4588},{"style":618},[4589],{"type":382,"value":3788},{"type":373,"tag":421,"props":4591,"children":4592},{"style":910},[4593],{"type":382,"value":4594},"e",{"type":373,"tag":421,"props":4596,"children":4597},{"style":618},[4598],{"type":382,"value":1350},{"type":373,"tag":421,"props":4600,"children":4601},{"style":624},[4602],{"type":382,"value":3802},{"type":373,"tag":421,"props":4604,"children":4605},{"style":618},[4606],{"type":382,"value":1099},{"type":373,"tag":421,"props":4608,"children":4609},{"style":577},[4610],{"type":382,"value":4611},"deliveries",{"type":373,"tag":421,"props":4613,"children":4614},{"style":618},[4615],{"type":382,"value":4616},"(e.id, { limit: ",{"type":373,"tag":421,"props":4618,"children":4619},{"style":798},[4620],{"type":382,"value":4621},"10",{"type":373,"tag":421,"props":4623,"children":4624},{"style":618},[4625],{"type":382,"value":4626}," })),\n",{"type":373,"tag":421,"props":4628,"children":4629},{"class":423,"line":1074},[4630],{"type":373,"tag":421,"props":4631,"children":4632},{"style":618},[4633],{"type":382,"value":4215},{"type":373,"tag":421,"props":4635,"children":4636},{"class":423,"line":1112},[4637],{"type":373,"tag":421,"props":4638,"children":4639},{"emptyLinePlaceholder":779},[4640],{"type":382,"value":782},{"type":373,"tag":421,"props":4642,"children":4643},{"class":423,"line":1164},[4644,4648],{"type":373,"tag":421,"props":4645,"children":4646},{"style":624},[4647],{"type":382,"value":1170},{"type":373,"tag":421,"props":4649,"children":4650},{"style":618},[4651],{"type":382,"value":3599},{"type":373,"tag":421,"props":4653,"children":4654},{"class":423,"line":1178},[4655,4659,4664],{"type":373,"tag":421,"props":4656,"children":4657},{"style":618},[4658],{"type":382,"value":3607},{"type":373,"tag":421,"props":4660,"children":4661},{"style":3610},[4662],{"type":382,"value":4663},"main",{"type":373,"tag":421,"props":4665,"children":4666},{"style":618},[4667],{"type":382,"value":3644},{"type":373,"tag":421,"props":4669,"children":4670},{"class":423,"line":1186},[4671,4675,4680,4685,4689],{"type":373,"tag":421,"props":4672,"children":4673},{"style":618},[4674],{"type":382,"value":3634},{"type":373,"tag":421,"props":4676,"children":4677},{"style":3610},[4678],{"type":382,"value":4679},"h1",{"type":373,"tag":421,"props":4681,"children":4682},{"style":618},[4683],{"type":382,"value":4684},">Webhooks\u003C/",{"type":373,"tag":421,"props":4686,"children":4687},{"style":3610},[4688],{"type":382,"value":4679},{"type":373,"tag":421,"props":4690,"children":4691},{"style":618},[4692],{"type":382,"value":3644},{"type":373,"tag":421,"props":4694,"children":4695},{"class":423,"line":1194},[4696,4700,4704],{"type":373,"tag":421,"props":4697,"children":4698},{"style":618},[4699],{"type":382,"value":3634},{"type":373,"tag":421,"props":4701,"children":4702},{"style":3610},[4703],{"type":382,"value":374},{"type":373,"tag":421,"props":4705,"children":4706},{"style":618},[4707],{"type":382,"value":3644},{"type":373,"tag":421,"props":4709,"children":4710},{"class":423,"line":1203},[4711],{"type":373,"tag":421,"props":4712,"children":4713},{"style":618},[4714],{"type":382,"value":4715},"        We sign every webhook with the Standard Webhooks scheme (webhook-id, webhook-timestamp,\n",{"type":373,"tag":421,"props":4717,"children":4718},{"class":423,"line":1244},[4719],{"type":373,"tag":421,"props":4720,"children":4721},{"style":618},[4722],{"type":382,"value":4723},"        webhook-signature) and retry failures for up to 48 hours.\n",{"type":373,"tag":421,"props":4725,"children":4726},{"class":423,"line":1258},[4727,4731,4735],{"type":373,"tag":421,"props":4728,"children":4729},{"style":618},[4730],{"type":382,"value":3722},{"type":373,"tag":421,"props":4732,"children":4733},{"style":3610},[4734],{"type":382,"value":374},{"type":373,"tag":421,"props":4736,"children":4737},{"style":618},[4738],{"type":382,"value":3644},{"type":373,"tag":421,"props":4740,"children":4741},{"class":423,"line":1285},[4742],{"type":373,"tag":421,"props":4743,"children":4744},{"emptyLinePlaceholder":779},[4745],{"type":382,"value":782},{"type":373,"tag":421,"props":4747,"children":4748},{"class":423,"line":1304},[4749,4753,4758,4762,4766,4771,4776,4780,4784,4788,4792,4797],{"type":373,"tag":421,"props":4750,"children":4751},{"style":618},[4752],{"type":382,"value":3634},{"type":373,"tag":421,"props":4754,"children":4755},{"style":798},[4756],{"type":382,"value":4757},"AddEndpointForm",{"type":373,"tag":421,"props":4759,"children":4760},{"style":577},[4761],{"type":382,"value":2147},{"type":373,"tag":421,"props":4763,"children":4764},{"style":624},[4765],{"type":382,"value":627},{"type":373,"tag":421,"props":4767,"children":4768},{"style":618},[4769],{"type":382,"value":4770},"{eventTypes.",{"type":373,"tag":421,"props":4772,"children":4773},{"style":577},[4774],{"type":382,"value":4775},"filter",{"type":373,"tag":421,"props":4777,"children":4778},{"style":618},[4779],{"type":382,"value":3788},{"type":373,"tag":421,"props":4781,"children":4782},{"style":910},[4783],{"type":382,"value":3793},{"type":373,"tag":421,"props":4785,"children":4786},{"style":618},[4787],{"type":382,"value":1350},{"type":373,"tag":421,"props":4789,"children":4790},{"style":624},[4791],{"type":382,"value":3802},{"type":373,"tag":421,"props":4793,"children":4794},{"style":624},[4795],{"type":382,"value":4796}," !",{"type":373,"tag":421,"props":4798,"children":4799},{"style":618},[4800],{"type":382,"value":4801},"t.deprecated)} />\n",{"type":373,"tag":421,"props":4803,"children":4804},{"class":423,"line":1363},[4805],{"type":373,"tag":421,"props":4806,"children":4807},{"emptyLinePlaceholder":779},[4808],{"type":382,"value":782},{"type":373,"tag":421,"props":4810,"children":4811},{"class":423,"line":1377},[4812,4817,4821,4825,4830,4834,4839,4843,4847],{"type":373,"tag":421,"props":4813,"children":4814},{"style":618},[4815],{"type":382,"value":4816},"      {endpoints.",{"type":373,"tag":421,"props":4818,"children":4819},{"style":577},[4820],{"type":382,"value":2179},{"type":373,"tag":421,"props":4822,"children":4823},{"style":618},[4824],{"type":382,"value":3788},{"type":373,"tag":421,"props":4826,"children":4827},{"style":910},[4828],{"type":382,"value":4829},"endpoint",{"type":373,"tag":421,"props":4831,"children":4832},{"style":618},[4833],{"type":382,"value":1053},{"type":373,"tag":421,"props":4835,"children":4836},{"style":910},[4837],{"type":382,"value":4838},"i",{"type":373,"tag":421,"props":4840,"children":4841},{"style":618},[4842],{"type":382,"value":1350},{"type":373,"tag":421,"props":4844,"children":4845},{"style":624},[4846],{"type":382,"value":3802},{"type":373,"tag":421,"props":4848,"children":4849},{"style":618},[4850],{"type":382,"value":3599},{"type":373,"tag":421,"props":4852,"children":4853},{"class":423,"line":1386},[4854,4858,4863,4867,4871],{"type":373,"tag":421,"props":4855,"children":4856},{"style":618},[4857],{"type":382,"value":3660},{"type":373,"tag":421,"props":4859,"children":4860},{"style":3610},[4861],{"type":382,"value":4862},"section",{"type":373,"tag":421,"props":4864,"children":4865},{"style":577},[4866],{"type":382,"value":3823},{"type":373,"tag":421,"props":4868,"children":4869},{"style":624},[4870],{"type":382,"value":627},{"type":373,"tag":421,"props":4872,"children":4873},{"style":618},[4874],{"type":382,"value":4875},"{endpoint.id}>\n",{"type":373,"tag":421,"props":4877,"children":4878},{"class":423,"line":1394},[4879,4883,4887,4892,4896],{"type":373,"tag":421,"props":4880,"children":4881},{"style":618},[4882],{"type":382,"value":3814},{"type":373,"tag":421,"props":4884,"children":4885},{"style":3610},[4886],{"type":382,"value":495},{"type":373,"tag":421,"props":4888,"children":4889},{"style":618},[4890],{"type":382,"value":4891},">{endpoint.url}\u003C/",{"type":373,"tag":421,"props":4893,"children":4894},{"style":3610},[4895],{"type":382,"value":495},{"type":373,"tag":421,"props":4897,"children":4898},{"style":618},[4899],{"type":382,"value":3644},{"type":373,"tag":421,"props":4901,"children":4902},{"class":423,"line":1402},[4903,4907,4911],{"type":373,"tag":421,"props":4904,"children":4905},{"style":618},[4906],{"type":382,"value":3814},{"type":373,"tag":421,"props":4908,"children":4909},{"style":3610},[4910],{"type":382,"value":374},{"type":373,"tag":421,"props":4912,"children":4913},{"style":618},[4914],{"type":382,"value":3644},{"type":373,"tag":421,"props":4916,"children":4917},{"class":423,"line":1411},[4918,4923,4928,4932,4937,4942,4947],{"type":373,"tag":421,"props":4919,"children":4920},{"style":618},[4921],{"type":382,"value":4922},"            {endpoint.state} · events: {endpoint.event_types.",{"type":373,"tag":421,"props":4924,"children":4925},{"style":577},[4926],{"type":382,"value":4927},"join",{"type":373,"tag":421,"props":4929,"children":4930},{"style":618},[4931],{"type":382,"value":907},{"type":373,"tag":421,"props":4933,"children":4934},{"style":583},[4935],{"type":382,"value":4936},"\", \"",{"type":373,"tag":421,"props":4938,"children":4939},{"style":618},[4940],{"type":382,"value":4941},")} · last 24h:{",{"type":373,"tag":421,"props":4943,"children":4944},{"style":583},[4945],{"type":382,"value":4946},"\" \"",{"type":373,"tag":421,"props":4948,"children":4949},{"style":618},[4950],{"type":382,"value":993},{"type":373,"tag":421,"props":4952,"children":4953},{"class":423,"line":1504},[4954,4959,4963,4967,4972,4976,4980],{"type":373,"tag":421,"props":4955,"children":4956},{"style":618},[4957],{"type":382,"value":4958},"            {endpoint.stats?.attempts ",{"type":373,"tag":421,"props":4960,"children":4961},{"style":624},[4962],{"type":382,"value":2117},{"type":373,"tag":421,"props":4964,"children":4965},{"style":798},[4966],{"type":382,"value":2277},{"type":373,"tag":421,"props":4968,"children":4969},{"style":618},[4970],{"type":382,"value":4971},"} attempts, {endpoint.stats?.failures ",{"type":373,"tag":421,"props":4973,"children":4974},{"style":624},[4975],{"type":382,"value":2117},{"type":373,"tag":421,"props":4977,"children":4978},{"style":798},[4979],{"type":382,"value":2277},{"type":373,"tag":421,"props":4981,"children":4982},{"style":618},[4983],{"type":382,"value":4984},"} failed\n",{"type":373,"tag":421,"props":4986,"children":4987},{"class":423,"line":1516},[4988,4992,4996],{"type":373,"tag":421,"props":4989,"children":4990},{"style":618},[4991],{"type":382,"value":3950},{"type":373,"tag":421,"props":4993,"children":4994},{"style":3610},[4995],{"type":382,"value":374},{"type":373,"tag":421,"props":4997,"children":4998},{"style":618},[4999],{"type":382,"value":3644},{"type":373,"tag":421,"props":5001,"children":5002},{"class":423,"line":1543},[5003],{"type":373,"tag":421,"props":5004,"children":5005},{"emptyLinePlaceholder":779},[5006],{"type":382,"value":782},{"type":373,"tag":421,"props":5008,"children":5009},{"class":423,"line":1559},[5010,5014,5019],{"type":373,"tag":421,"props":5011,"children":5012},{"style":618},[5013],{"type":382,"value":3814},{"type":373,"tag":421,"props":5015,"children":5016},{"style":3610},[5017],{"type":382,"value":5018},"table",{"type":373,"tag":421,"props":5020,"children":5021},{"style":618},[5022],{"type":382,"value":3644},{"type":373,"tag":421,"props":5024,"children":5025},{"class":423,"line":1612},[5026,5030,5035],{"type":373,"tag":421,"props":5027,"children":5028},{"style":618},[5029],{"type":382,"value":3840},{"type":373,"tag":421,"props":5031,"children":5032},{"style":3610},[5033],{"type":382,"value":5034},"thead",{"type":373,"tag":421,"props":5036,"children":5037},{"style":618},[5038],{"type":382,"value":3644},{"type":373,"tag":421,"props":5040,"children":5041},{"class":423,"line":1624},[5042,5047,5052,5057,5062,5067,5071,5075,5079,5084,5088,5092,5096,5101,5105,5109,5113,5118,5122],{"type":373,"tag":421,"props":5043,"children":5044},{"style":618},[5045],{"type":382,"value":5046},"              \u003C",{"type":373,"tag":421,"props":5048,"children":5049},{"style":3610},[5050],{"type":382,"value":5051},"tr",{"type":373,"tag":421,"props":5053,"children":5054},{"style":618},[5055],{"type":382,"value":5056},">\u003C",{"type":373,"tag":421,"props":5058,"children":5059},{"style":3610},[5060],{"type":382,"value":5061},"th",{"type":373,"tag":421,"props":5063,"children":5064},{"style":618},[5065],{"type":382,"value":5066},">Event\u003C/",{"type":373,"tag":421,"props":5068,"children":5069},{"style":3610},[5070],{"type":382,"value":5061},{"type":373,"tag":421,"props":5072,"children":5073},{"style":618},[5074],{"type":382,"value":5056},{"type":373,"tag":421,"props":5076,"children":5077},{"style":3610},[5078],{"type":382,"value":5061},{"type":373,"tag":421,"props":5080,"children":5081},{"style":618},[5082],{"type":382,"value":5083},">Message\u003C/",{"type":373,"tag":421,"props":5085,"children":5086},{"style":3610},[5087],{"type":382,"value":5061},{"type":373,"tag":421,"props":5089,"children":5090},{"style":618},[5091],{"type":382,"value":5056},{"type":373,"tag":421,"props":5093,"children":5094},{"style":3610},[5095],{"type":382,"value":5061},{"type":373,"tag":421,"props":5097,"children":5098},{"style":618},[5099],{"type":382,"value":5100},">Last response\u003C/",{"type":373,"tag":421,"props":5102,"children":5103},{"style":3610},[5104],{"type":382,"value":5061},{"type":373,"tag":421,"props":5106,"children":5107},{"style":618},[5108],{"type":382,"value":5056},{"type":373,"tag":421,"props":5110,"children":5111},{"style":3610},[5112],{"type":382,"value":5061},{"type":373,"tag":421,"props":5114,"children":5115},{"style":618},[5116],{"type":382,"value":5117}," />\u003C/",{"type":373,"tag":421,"props":5119,"children":5120},{"style":3610},[5121],{"type":382,"value":5051},{"type":373,"tag":421,"props":5123,"children":5124},{"style":618},[5125],{"type":382,"value":3644},{"type":373,"tag":421,"props":5127,"children":5128},{"class":423,"line":1632},[5129,5134,5138],{"type":373,"tag":421,"props":5130,"children":5131},{"style":618},[5132],{"type":382,"value":5133},"            \u003C/",{"type":373,"tag":421,"props":5135,"children":5136},{"style":3610},[5137],{"type":382,"value":5034},{"type":373,"tag":421,"props":5139,"children":5140},{"style":618},[5141],{"type":382,"value":3644},{"type":373,"tag":421,"props":5143,"children":5144},{"class":423,"line":2716},[5145,5149,5154],{"type":373,"tag":421,"props":5146,"children":5147},{"style":618},[5148],{"type":382,"value":3840},{"type":373,"tag":421,"props":5150,"children":5151},{"style":3610},[5152],{"type":382,"value":5153},"tbody",{"type":373,"tag":421,"props":5155,"children":5156},{"style":618},[5157],{"type":382,"value":3644},{"type":373,"tag":421,"props":5159,"children":5160},{"class":423,"line":2757},[5161,5166,5170,5174,5179,5183,5187],{"type":373,"tag":421,"props":5162,"children":5163},{"style":618},[5164],{"type":382,"value":5165},"              {deliveries[i].",{"type":373,"tag":421,"props":5167,"children":5168},{"style":577},[5169],{"type":382,"value":2179},{"type":373,"tag":421,"props":5171,"children":5172},{"style":618},[5173],{"type":382,"value":3788},{"type":373,"tag":421,"props":5175,"children":5176},{"style":910},[5177],{"type":382,"value":5178},"d",{"type":373,"tag":421,"props":5180,"children":5181},{"style":618},[5182],{"type":382,"value":1350},{"type":373,"tag":421,"props":5184,"children":5185},{"style":624},[5186],{"type":382,"value":3802},{"type":373,"tag":421,"props":5188,"children":5189},{"style":618},[5190],{"type":382,"value":3599},{"type":373,"tag":421,"props":5192,"children":5193},{"class":423,"line":2785},[5194,5199,5203,5207,5211],{"type":373,"tag":421,"props":5195,"children":5196},{"style":618},[5197],{"type":382,"value":5198},"                \u003C",{"type":373,"tag":421,"props":5200,"children":5201},{"style":3610},[5202],{"type":382,"value":5051},{"type":373,"tag":421,"props":5204,"children":5205},{"style":577},[5206],{"type":382,"value":3823},{"type":373,"tag":421,"props":5208,"children":5209},{"style":624},[5210],{"type":382,"value":627},{"type":373,"tag":421,"props":5212,"children":5213},{"style":618},[5214],{"type":382,"value":5215},"{d.id}>\n",{"type":373,"tag":421,"props":5217,"children":5218},{"class":423,"line":2837},[5219,5224,5229,5234,5238],{"type":373,"tag":421,"props":5220,"children":5221},{"style":618},[5222],{"type":382,"value":5223},"                  \u003C",{"type":373,"tag":421,"props":5225,"children":5226},{"style":3610},[5227],{"type":382,"value":5228},"td",{"type":373,"tag":421,"props":5230,"children":5231},{"style":618},[5232],{"type":382,"value":5233},">{d.event_type}\u003C/",{"type":373,"tag":421,"props":5235,"children":5236},{"style":3610},[5237],{"type":382,"value":5228},{"type":373,"tag":421,"props":5239,"children":5240},{"style":618},[5241],{"type":382,"value":3644},{"type":373,"tag":421,"props":5243,"children":5244},{"class":423,"line":2884},[5245,5249,5253,5257,5261,5266,5270,5275,5279],{"type":373,"tag":421,"props":5246,"children":5247},{"style":618},[5248],{"type":382,"value":5223},{"type":373,"tag":421,"props":5250,"children":5251},{"style":3610},[5252],{"type":382,"value":5228},{"type":373,"tag":421,"props":5254,"children":5255},{"style":618},[5256],{"type":382,"value":5056},{"type":373,"tag":421,"props":5258,"children":5259},{"style":3610},[5260],{"type":382,"value":385},{"type":373,"tag":421,"props":5262,"children":5263},{"style":618},[5264],{"type":382,"value":5265},">{d.message_id}\u003C/",{"type":373,"tag":421,"props":5267,"children":5268},{"style":3610},[5269],{"type":382,"value":385},{"type":373,"tag":421,"props":5271,"children":5272},{"style":618},[5273],{"type":382,"value":5274},">\u003C/",{"type":373,"tag":421,"props":5276,"children":5277},{"style":3610},[5278],{"type":382,"value":5228},{"type":373,"tag":421,"props":5280,"children":5281},{"style":618},[5282],{"type":382,"value":3644},{"type":373,"tag":421,"props":5284,"children":5285},{"class":423,"line":2904},[5286,5290,5294,5299,5303,5308,5312,5316],{"type":373,"tag":421,"props":5287,"children":5288},{"style":618},[5289],{"type":382,"value":5223},{"type":373,"tag":421,"props":5291,"children":5292},{"style":3610},[5293],{"type":382,"value":5228},{"type":373,"tag":421,"props":5295,"children":5296},{"style":618},[5297],{"type":382,"value":5298},">{d.status_code ",{"type":373,"tag":421,"props":5300,"children":5301},{"style":624},[5302],{"type":382,"value":2117},{"type":373,"tag":421,"props":5304,"children":5305},{"style":583},[5306],{"type":382,"value":5307}," \"pending\"",{"type":373,"tag":421,"props":5309,"children":5310},{"style":618},[5311],{"type":382,"value":4030},{"type":373,"tag":421,"props":5313,"children":5314},{"style":3610},[5315],{"type":382,"value":5228},{"type":373,"tag":421,"props":5317,"children":5318},{"style":618},[5319],{"type":382,"value":3644},{"type":373,"tag":421,"props":5321,"children":5322},{"class":423,"line":2912},[5323,5327,5331],{"type":373,"tag":421,"props":5324,"children":5325},{"style":618},[5326],{"type":382,"value":5223},{"type":373,"tag":421,"props":5328,"children":5329},{"style":3610},[5330],{"type":382,"value":5228},{"type":373,"tag":421,"props":5332,"children":5333},{"style":618},[5334],{"type":382,"value":3644},{"type":373,"tag":421,"props":5336,"children":5337},{"class":423,"line":2920},[5338,5343,5347,5351,5355],{"type":373,"tag":421,"props":5339,"children":5340},{"style":618},[5341],{"type":382,"value":5342},"                    \u003C",{"type":373,"tag":421,"props":5344,"children":5345},{"style":3610},[5346],{"type":382,"value":2003},{"type":373,"tag":421,"props":5348,"children":5349},{"style":577},[5350],{"type":382,"value":3617},{"type":373,"tag":421,"props":5352,"children":5353},{"style":624},[5354],{"type":382,"value":627},{"type":373,"tag":421,"props":5356,"children":5357},{"style":618},[5358],{"type":382,"value":5359},"{retryDelivery}>\n",{"type":373,"tag":421,"props":5361,"children":5362},{"class":423,"line":2961},[5363,5368,5372,5376,5380,5385,5389,5393,5397,5401,5405],{"type":373,"tag":421,"props":5364,"children":5365},{"style":618},[5366],{"type":382,"value":5367},"                      \u003C",{"type":373,"tag":421,"props":5369,"children":5370},{"style":3610},[5371],{"type":382,"value":3665},{"type":373,"tag":421,"props":5373,"children":5374},{"style":577},[5375],{"type":382,"value":1902},{"type":373,"tag":421,"props":5377,"children":5378},{"style":624},[5379],{"type":382,"value":627},{"type":373,"tag":421,"props":5381,"children":5382},{"style":583},[5383],{"type":382,"value":5384},"\"hidden\"",{"type":373,"tag":421,"props":5386,"children":5387},{"style":577},[5388],{"type":382,"value":3670},{"type":373,"tag":421,"props":5390,"children":5391},{"style":624},[5392],{"type":382,"value":627},{"type":373,"tag":421,"props":5394,"children":5395},{"style":583},[5396],{"type":382,"value":2653},{"type":373,"tag":421,"props":5398,"children":5399},{"style":577},[5400],{"type":382,"value":3874},{"type":373,"tag":421,"props":5402,"children":5403},{"style":624},[5404],{"type":382,"value":627},{"type":373,"tag":421,"props":5406,"children":5407},{"style":618},[5408],{"type":382,"value":5409},"{endpoint.id} />\n",{"type":373,"tag":421,"props":5411,"children":5412},{"class":423,"line":2989},[5413,5417,5421,5425,5429,5433,5437,5441,5445,5449,5453],{"type":373,"tag":421,"props":5414,"children":5415},{"style":618},[5416],{"type":382,"value":5367},{"type":373,"tag":421,"props":5418,"children":5419},{"style":3610},[5420],{"type":382,"value":3665},{"type":373,"tag":421,"props":5422,"children":5423},{"style":577},[5424],{"type":382,"value":1902},{"type":373,"tag":421,"props":5426,"children":5427},{"style":624},[5428],{"type":382,"value":627},{"type":373,"tag":421,"props":5430,"children":5431},{"style":583},[5432],{"type":382,"value":5384},{"type":373,"tag":421,"props":5434,"children":5435},{"style":577},[5436],{"type":382,"value":3670},{"type":373,"tag":421,"props":5438,"children":5439},{"style":624},[5440],{"type":382,"value":627},{"type":373,"tag":421,"props":5442,"children":5443},{"style":583},[5444],{"type":382,"value":2877},{"type":373,"tag":421,"props":5446,"children":5447},{"style":577},[5448],{"type":382,"value":3874},{"type":373,"tag":421,"props":5450,"children":5451},{"style":624},[5452],{"type":382,"value":627},{"type":373,"tag":421,"props":5454,"children":5455},{"style":618},[5456],{"type":382,"value":5457},"{d.message_id} />\n",{"type":373,"tag":421,"props":5459,"children":5460},{"class":423,"line":3041},[5461,5465,5469,5474,5478],{"type":373,"tag":421,"props":5462,"children":5463},{"style":618},[5464],{"type":382,"value":5367},{"type":373,"tag":421,"props":5466,"children":5467},{"style":3610},[5468],{"type":382,"value":3993},{"type":373,"tag":421,"props":5470,"children":5471},{"style":618},[5472],{"type":382,"value":5473},">Retry\u003C/",{"type":373,"tag":421,"props":5475,"children":5476},{"style":3610},[5477],{"type":382,"value":3993},{"type":373,"tag":421,"props":5479,"children":5480},{"style":618},[5481],{"type":382,"value":3644},{"type":373,"tag":421,"props":5483,"children":5484},{"class":423,"line":3050},[5485,5490,5494],{"type":373,"tag":421,"props":5486,"children":5487},{"style":618},[5488],{"type":382,"value":5489},"                    \u003C/",{"type":373,"tag":421,"props":5491,"children":5492},{"style":3610},[5493],{"type":382,"value":2003},{"type":373,"tag":421,"props":5495,"children":5496},{"style":618},[5497],{"type":382,"value":3644},{"type":373,"tag":421,"props":5499,"children":5500},{"class":423,"line":3071},[5501,5506,5510],{"type":373,"tag":421,"props":5502,"children":5503},{"style":618},[5504],{"type":382,"value":5505},"                  \u003C/",{"type":373,"tag":421,"props":5507,"children":5508},{"style":3610},[5509],{"type":382,"value":5228},{"type":373,"tag":421,"props":5511,"children":5512},{"style":618},[5513],{"type":382,"value":3644},{"type":373,"tag":421,"props":5515,"children":5516},{"class":423,"line":3091},[5517,5522,5526],{"type":373,"tag":421,"props":5518,"children":5519},{"style":618},[5520],{"type":382,"value":5521},"                \u003C/",{"type":373,"tag":421,"props":5523,"children":5524},{"style":3610},[5525],{"type":382,"value":5051},{"type":373,"tag":421,"props":5527,"children":5528},{"style":618},[5529],{"type":382,"value":3644},{"type":373,"tag":421,"props":5531,"children":5532},{"class":423,"line":3099},[5533],{"type":373,"tag":421,"props":5534,"children":5535},{"style":618},[5536],{"type":382,"value":5537},"              ))}\n",{"type":373,"tag":421,"props":5539,"children":5540},{"class":423,"line":3107},[5541,5545,5549],{"type":373,"tag":421,"props":5542,"children":5543},{"style":618},[5544],{"type":382,"value":5133},{"type":373,"tag":421,"props":5546,"children":5547},{"style":3610},[5548],{"type":382,"value":5153},{"type":373,"tag":421,"props":5550,"children":5551},{"style":618},[5552],{"type":382,"value":3644},{"type":373,"tag":421,"props":5554,"children":5555},{"class":423,"line":3184},[5556,5560,5564],{"type":373,"tag":421,"props":5557,"children":5558},{"style":618},[5559],{"type":382,"value":3950},{"type":373,"tag":421,"props":5561,"children":5562},{"style":3610},[5563],{"type":382,"value":5018},{"type":373,"tag":421,"props":5565,"children":5566},{"style":618},[5567],{"type":382,"value":3644},{"type":373,"tag":421,"props":5569,"children":5570},{"class":423,"line":3212},[5571],{"type":373,"tag":421,"props":5572,"children":5573},{"emptyLinePlaceholder":779},[5574],{"type":382,"value":782},{"type":373,"tag":421,"props":5576,"children":5577},{"class":423,"line":3264},[5578,5582,5586,5590,5594],{"type":373,"tag":421,"props":5579,"children":5580},{"style":618},[5581],{"type":382,"value":3814},{"type":373,"tag":421,"props":5583,"children":5584},{"style":3610},[5585],{"type":382,"value":2003},{"type":373,"tag":421,"props":5587,"children":5588},{"style":577},[5589],{"type":382,"value":3617},{"type":373,"tag":421,"props":5591,"children":5592},{"style":624},[5593],{"type":382,"value":627},{"type":373,"tag":421,"props":5595,"children":5596},{"style":618},[5597],{"type":382,"value":5598},"{resendFailed}>\n",{"type":373,"tag":421,"props":5600,"children":5601},{"class":423,"line":3273},[5602,5606,5610,5614,5618,5622,5626,5630,5634,5638,5642],{"type":373,"tag":421,"props":5603,"children":5604},{"style":618},[5605],{"type":382,"value":3840},{"type":373,"tag":421,"props":5607,"children":5608},{"style":3610},[5609],{"type":382,"value":3665},{"type":373,"tag":421,"props":5611,"children":5612},{"style":577},[5613],{"type":382,"value":1902},{"type":373,"tag":421,"props":5615,"children":5616},{"style":624},[5617],{"type":382,"value":627},{"type":373,"tag":421,"props":5619,"children":5620},{"style":583},[5621],{"type":382,"value":5384},{"type":373,"tag":421,"props":5623,"children":5624},{"style":577},[5625],{"type":382,"value":3670},{"type":373,"tag":421,"props":5627,"children":5628},{"style":624},[5629],{"type":382,"value":627},{"type":373,"tag":421,"props":5631,"children":5632},{"style":583},[5633],{"type":382,"value":2653},{"type":373,"tag":421,"props":5635,"children":5636},{"style":577},[5637],{"type":382,"value":3874},{"type":373,"tag":421,"props":5639,"children":5640},{"style":624},[5641],{"type":382,"value":627},{"type":373,"tag":421,"props":5643,"children":5644},{"style":618},[5645],{"type":382,"value":5409},{"type":373,"tag":421,"props":5647,"children":5648},{"class":423,"line":3305},[5649,5653,5657,5662,5666],{"type":373,"tag":421,"props":5650,"children":5651},{"style":618},[5652],{"type":382,"value":3840},{"type":373,"tag":421,"props":5654,"children":5655},{"style":3610},[5656],{"type":382,"value":3993},{"type":373,"tag":421,"props":5658,"children":5659},{"style":618},[5660],{"type":382,"value":5661},">Re-send failed deliveries (last 24h)\u003C/",{"type":373,"tag":421,"props":5663,"children":5664},{"style":3610},[5665],{"type":382,"value":3993},{"type":373,"tag":421,"props":5667,"children":5668},{"style":618},[5669],{"type":382,"value":3644},{"type":373,"tag":421,"props":5671,"children":5673},{"class":423,"line":5672},62,[5674,5678,5682],{"type":373,"tag":421,"props":5675,"children":5676},{"style":618},[5677],{"type":382,"value":3950},{"type":373,"tag":421,"props":5679,"children":5680},{"style":3610},[5681],{"type":382,"value":2003},{"type":373,"tag":421,"props":5683,"children":5684},{"style":618},[5685],{"type":382,"value":3644},{"type":373,"tag":421,"props":5687,"children":5689},{"class":423,"line":5688},63,[5690,5694,5698,5702,5706],{"type":373,"tag":421,"props":5691,"children":5692},{"style":618},[5693],{"type":382,"value":3814},{"type":373,"tag":421,"props":5695,"children":5696},{"style":3610},[5697],{"type":382,"value":2003},{"type":373,"tag":421,"props":5699,"children":5700},{"style":577},[5701],{"type":382,"value":3617},{"type":373,"tag":421,"props":5703,"children":5704},{"style":624},[5705],{"type":382,"value":627},{"type":373,"tag":421,"props":5707,"children":5708},{"style":618},[5709],{"type":382,"value":5710},"{deleteEndpoint}>\n",{"type":373,"tag":421,"props":5712,"children":5714},{"class":423,"line":5713},64,[5715,5719,5723,5727,5731,5735,5739,5743,5747,5751,5755],{"type":373,"tag":421,"props":5716,"children":5717},{"style":618},[5718],{"type":382,"value":3840},{"type":373,"tag":421,"props":5720,"children":5721},{"style":3610},[5722],{"type":382,"value":3665},{"type":373,"tag":421,"props":5724,"children":5725},{"style":577},[5726],{"type":382,"value":1902},{"type":373,"tag":421,"props":5728,"children":5729},{"style":624},[5730],{"type":382,"value":627},{"type":373,"tag":421,"props":5732,"children":5733},{"style":583},[5734],{"type":382,"value":5384},{"type":373,"tag":421,"props":5736,"children":5737},{"style":577},[5738],{"type":382,"value":3670},{"type":373,"tag":421,"props":5740,"children":5741},{"style":624},[5742],{"type":382,"value":627},{"type":373,"tag":421,"props":5744,"children":5745},{"style":583},[5746],{"type":382,"value":2653},{"type":373,"tag":421,"props":5748,"children":5749},{"style":577},[5750],{"type":382,"value":3874},{"type":373,"tag":421,"props":5752,"children":5753},{"style":624},[5754],{"type":382,"value":627},{"type":373,"tag":421,"props":5756,"children":5757},{"style":618},[5758],{"type":382,"value":5409},{"type":373,"tag":421,"props":5760,"children":5762},{"class":423,"line":5761},65,[5763,5767,5771,5776,5780],{"type":373,"tag":421,"props":5764,"children":5765},{"style":618},[5766],{"type":382,"value":3840},{"type":373,"tag":421,"props":5768,"children":5769},{"style":3610},[5770],{"type":382,"value":3993},{"type":373,"tag":421,"props":5772,"children":5773},{"style":618},[5774],{"type":382,"value":5775},">Delete endpoint\u003C/",{"type":373,"tag":421,"props":5777,"children":5778},{"style":3610},[5779],{"type":382,"value":3993},{"type":373,"tag":421,"props":5781,"children":5782},{"style":618},[5783],{"type":382,"value":3644},{"type":373,"tag":421,"props":5785,"children":5787},{"class":423,"line":5786},66,[5788,5792,5796],{"type":373,"tag":421,"props":5789,"children":5790},{"style":618},[5791],{"type":382,"value":3950},{"type":373,"tag":421,"props":5793,"children":5794},{"style":3610},[5795],{"type":382,"value":2003},{"type":373,"tag":421,"props":5797,"children":5798},{"style":618},[5799],{"type":382,"value":3644},{"type":373,"tag":421,"props":5801,"children":5803},{"class":423,"line":5802},67,[5804,5808,5812],{"type":373,"tag":421,"props":5805,"children":5806},{"style":618},[5807],{"type":382,"value":4163},{"type":373,"tag":421,"props":5809,"children":5810},{"style":3610},[5811],{"type":382,"value":4862},{"type":373,"tag":421,"props":5813,"children":5814},{"style":618},[5815],{"type":382,"value":3644},{"type":373,"tag":421,"props":5817,"children":5819},{"class":423,"line":5818},68,[5820],{"type":373,"tag":421,"props":5821,"children":5822},{"style":618},[5823],{"type":382,"value":5824},"      ))}\n",{"type":373,"tag":421,"props":5826,"children":5828},{"class":423,"line":5827},69,[5829,5833,5837],{"type":373,"tag":421,"props":5830,"children":5831},{"style":618},[5832],{"type":382,"value":4199},{"type":373,"tag":421,"props":5834,"children":5835},{"style":3610},[5836],{"type":382,"value":4663},{"type":373,"tag":421,"props":5838,"children":5839},{"style":618},[5840],{"type":382,"value":3644},{"type":373,"tag":421,"props":5842,"children":5844},{"class":423,"line":5843},70,[5845],{"type":373,"tag":421,"props":5846,"children":5847},{"style":618},[5848],{"type":382,"value":4215},{"type":373,"tag":421,"props":5850,"children":5852},{"class":423,"line":5851},71,[5853],{"type":373,"tag":421,"props":5854,"children":5855},{"style":618},[5856],{"type":382,"value":993},{"type":373,"tag":374,"props":5858,"children":5859},{},[5860,5862,5867,5869,5875,5877,5882],{"type":382,"value":5861},"Add a \"Rotate secret\" button the same way as ",{"type":373,"tag":385,"props":5863,"children":5865},{"className":5864},[],[5866],{"type":382,"value":4757},{"type":382,"value":5868},", wiring ",{"type":373,"tag":385,"props":5870,"children":5872},{"className":5871},[],[5873],{"type":382,"value":5874},"useActionState",{"type":382,"value":5876}," to ",{"type":373,"tag":385,"props":5878,"children":5880},{"className":5879},[],[5881],{"type":382,"value":3297},{"type":382,"value":5883}," so the new secret is displayed once.",{"type":373,"tag":495,"props":5885,"children":5887},{"id":5886},"_5-publish-events-from-your-business-logic",[5888],{"type":382,"value":5889},"5. Publish events from your business logic",{"type":373,"tag":374,"props":5891,"children":5892},{},[5893],{"type":382,"value":5894},"Publish after the database change commits, with an idempotency key derived from the event. If the request is retried, or the handler runs twice, the second publish returns the original receipt and nothing is delivered twice.",{"type":373,"tag":412,"props":5896,"children":5898},{"className":715,"code":5897,"language":717,"meta":345,"style":345},"// app/api/invoices/[id]/pay/route.ts\nimport { NextResponse } from \"next/server\";\nimport { getCurrentOrg } from \"@/lib/auth\";\nimport { publishEvent } from \"@/lib/webhooks\";\n\n// Your own data layer.\nasync function markInvoicePaid(orgId: string, invoiceId: string) {\n  return { id: invoiceId, orgId, amount: 4900, currency: \"usd\", paidAt: new Date().toISOString() };\n}\n\nexport async function POST(_req: Request, { params }: { params: Promise\u003C{ id: string }> }) {\n  const { id } = await params;\n  const org = await getCurrentOrg();\n  const invoice = await markInvoicePaid(org.id, id); // commits first\n\n  await publishEvent(\n    org.id,\n    \"invoice.paid\",\n    { invoice_id: invoice.id, amount: invoice.amount, currency: invoice.currency, paid_at: invoice.paidAt },\n    `invoice-paid:${invoice.id}`,\n  );\n\n  return NextResponse.json({ ok: true });\n}\n",[5899],{"type":373,"tag":385,"props":5900,"children":5901},{"__ignoreMap":345},[5902,5910,5935,5958,5982,5989,5997,6051,6108,6115,6122,6215,6248,6275,6309,6316,6331,6339,6351,6359,6389,6396,6403,6434],{"type":373,"tag":421,"props":5903,"children":5904},{"class":423,"line":424},[5905],{"type":373,"tag":421,"props":5906,"children":5907},{"style":609},[5908],{"type":382,"value":5909},"// app/api/invoices/[id]/pay/route.ts\n",{"type":373,"tag":421,"props":5911,"children":5912},{"class":423,"line":433},[5913,5917,5922,5926,5931],{"type":373,"tag":421,"props":5914,"children":5915},{"style":624},[5916],{"type":382,"value":737},{"type":373,"tag":421,"props":5918,"children":5919},{"style":618},[5920],{"type":382,"value":5921}," { NextResponse } ",{"type":373,"tag":421,"props":5923,"children":5924},{"style":624},[5925],{"type":382,"value":764},{"type":373,"tag":421,"props":5927,"children":5928},{"style":583},[5929],{"type":382,"value":5930}," \"next/server\"",{"type":373,"tag":421,"props":5932,"children":5933},{"style":618},[5934],{"type":382,"value":747},{"type":373,"tag":421,"props":5936,"children":5937},{"class":423,"line":442},[5938,5942,5946,5950,5954],{"type":373,"tag":421,"props":5939,"children":5940},{"style":624},[5941],{"type":382,"value":737},{"type":373,"tag":421,"props":5943,"children":5944},{"style":618},[5945],{"type":382,"value":1845},{"type":373,"tag":421,"props":5947,"children":5948},{"style":624},[5949],{"type":382,"value":764},{"type":373,"tag":421,"props":5951,"children":5952},{"style":583},[5953],{"type":382,"value":1854},{"type":373,"tag":421,"props":5955,"children":5956},{"style":618},[5957],{"type":382,"value":747},{"type":373,"tag":421,"props":5959,"children":5960},{"class":423,"line":451},[5961,5965,5970,5974,5978],{"type":373,"tag":421,"props":5962,"children":5963},{"style":624},[5964],{"type":382,"value":737},{"type":373,"tag":421,"props":5966,"children":5967},{"style":618},[5968],{"type":382,"value":5969}," { publishEvent } ",{"type":373,"tag":421,"props":5971,"children":5972},{"style":624},[5973],{"type":382,"value":764},{"type":373,"tag":421,"props":5975,"children":5976},{"style":583},[5977],{"type":382,"value":1879},{"type":373,"tag":421,"props":5979,"children":5980},{"style":618},[5981],{"type":382,"value":747},{"type":373,"tag":421,"props":5983,"children":5984},{"class":423,"line":460},[5985],{"type":373,"tag":421,"props":5986,"children":5987},{"emptyLinePlaceholder":779},[5988],{"type":382,"value":782},{"type":373,"tag":421,"props":5990,"children":5991},{"class":423,"line":469},[5992],{"type":373,"tag":421,"props":5993,"children":5994},{"style":609},[5995],{"type":382,"value":5996},"// Your own data layer.\n",{"type":373,"tag":421,"props":5998,"children":5999},{"class":423,"line":478},[6000,6005,6009,6014,6018,6022,6026,6030,6034,6039,6043,6047],{"type":373,"tag":421,"props":6001,"children":6002},{"style":624},[6003],{"type":382,"value":6004},"async",{"type":373,"tag":421,"props":6006,"children":6007},{"style":624},[6008],{"type":382,"value":897},{"type":373,"tag":421,"props":6010,"children":6011},{"style":577},[6012],{"type":382,"value":6013}," markInvoicePaid",{"type":373,"tag":421,"props":6015,"children":6016},{"style":618},[6017],{"type":382,"value":907},{"type":373,"tag":421,"props":6019,"children":6020},{"style":910},[6021],{"type":382,"value":1040},{"type":373,"tag":421,"props":6023,"children":6024},{"style":624},[6025],{"type":382,"value":918},{"type":373,"tag":421,"props":6027,"children":6028},{"style":798},[6029],{"type":382,"value":937},{"type":373,"tag":421,"props":6031,"children":6032},{"style":618},[6033],{"type":382,"value":1053},{"type":373,"tag":421,"props":6035,"children":6036},{"style":910},[6037],{"type":382,"value":6038},"invoiceId",{"type":373,"tag":421,"props":6040,"children":6041},{"style":624},[6042],{"type":382,"value":918},{"type":373,"tag":421,"props":6044,"children":6045},{"style":798},[6046],{"type":382,"value":937},{"type":373,"tag":421,"props":6048,"children":6049},{"style":618},[6050],{"type":382,"value":1071},{"type":373,"tag":421,"props":6052,"children":6053},{"class":423,"line":487},[6054,6058,6063,6068,6073,6078,6083,6088,6093,6098,6103],{"type":373,"tag":421,"props":6055,"children":6056},{"style":624},[6057],{"type":382,"value":1170},{"type":373,"tag":421,"props":6059,"children":6060},{"style":618},[6061],{"type":382,"value":6062}," { id: invoiceId, orgId, amount: ",{"type":373,"tag":421,"props":6064,"children":6065},{"style":798},[6066],{"type":382,"value":6067},"4900",{"type":373,"tag":421,"props":6069,"children":6070},{"style":618},[6071],{"type":382,"value":6072},", currency: ",{"type":373,"tag":421,"props":6074,"children":6075},{"style":583},[6076],{"type":382,"value":6077},"\"usd\"",{"type":373,"tag":421,"props":6079,"children":6080},{"style":618},[6081],{"type":382,"value":6082},", paidAt: ",{"type":373,"tag":421,"props":6084,"children":6085},{"style":624},[6086],{"type":382,"value":6087},"new",{"type":373,"tag":421,"props":6089,"children":6090},{"style":577},[6091],{"type":382,"value":6092}," Date",{"type":373,"tag":421,"props":6094,"children":6095},{"style":618},[6096],{"type":382,"value":6097},"().",{"type":373,"tag":421,"props":6099,"children":6100},{"style":577},[6101],{"type":382,"value":6102},"toISOString",{"type":373,"tag":421,"props":6104,"children":6105},{"style":618},[6106],{"type":382,"value":6107},"() };\n",{"type":373,"tag":421,"props":6109,"children":6110},{"class":423,"line":865},[6111],{"type":373,"tag":421,"props":6112,"children":6113},{"style":618},[6114],{"type":382,"value":993},{"type":373,"tag":421,"props":6116,"children":6117},{"class":423,"line":873},[6118],{"type":373,"tag":421,"props":6119,"children":6120},{"emptyLinePlaceholder":779},[6121],{"type":382,"value":782},{"type":373,"tag":421,"props":6123,"children":6124},{"class":423,"line":882},[6125,6129,6133,6137,6142,6146,6151,6155,6160,6165,6170,6174,6178,6182,6186,6190,6194,6198,6202,6206,6210],{"type":373,"tag":421,"props":6126,"children":6127},{"style":624},[6128],{"type":382,"value":790},{"type":373,"tag":421,"props":6130,"children":6131},{"style":624},[6132],{"type":382,"value":892},{"type":373,"tag":421,"props":6134,"children":6135},{"style":624},[6136],{"type":382,"value":897},{"type":373,"tag":421,"props":6138,"children":6139},{"style":577},[6140],{"type":382,"value":6141}," POST",{"type":373,"tag":421,"props":6143,"children":6144},{"style":618},[6145],{"type":382,"value":907},{"type":373,"tag":421,"props":6147,"children":6148},{"style":910},[6149],{"type":382,"value":6150},"_req",{"type":373,"tag":421,"props":6152,"children":6153},{"style":624},[6154],{"type":382,"value":918},{"type":373,"tag":421,"props":6156,"children":6157},{"style":577},[6158],{"type":382,"value":6159}," Request",{"type":373,"tag":421,"props":6161,"children":6162},{"style":618},[6163],{"type":382,"value":6164},", { ",{"type":373,"tag":421,"props":6166,"children":6167},{"style":910},[6168],{"type":382,"value":6169},"params",{"type":373,"tag":421,"props":6171,"children":6172},{"style":618},[6173],{"type":382,"value":3455},{"type":373,"tag":421,"props":6175,"children":6176},{"style":624},[6177],{"type":382,"value":918},{"type":373,"tag":421,"props":6179,"children":6180},{"style":618},[6181],{"type":382,"value":923},{"type":373,"tag":421,"props":6183,"children":6184},{"style":910},[6185],{"type":382,"value":6169},{"type":373,"tag":421,"props":6187,"children":6188},{"style":624},[6189],{"type":382,"value":918},{"type":373,"tag":421,"props":6191,"children":6192},{"style":577},[6193],{"type":382,"value":1686},{"type":373,"tag":421,"props":6195,"children":6196},{"style":618},[6197],{"type":382,"value":1691},{"type":373,"tag":421,"props":6199,"children":6200},{"style":910},[6201],{"type":382,"value":928},{"type":373,"tag":421,"props":6203,"children":6204},{"style":624},[6205],{"type":382,"value":918},{"type":373,"tag":421,"props":6207,"children":6208},{"style":798},[6209],{"type":382,"value":937},{"type":373,"tag":421,"props":6211,"children":6212},{"style":618},[6213],{"type":382,"value":6214}," }> }) {\n",{"type":373,"tag":421,"props":6216,"children":6217},{"class":423,"line":963},[6218,6222,6226,6230,6235,6239,6243],{"type":373,"tag":421,"props":6219,"children":6220},{"style":624},[6221],{"type":382,"value":1080},{"type":373,"tag":421,"props":6223,"children":6224},{"style":618},[6225],{"type":382,"value":923},{"type":373,"tag":421,"props":6227,"children":6228},{"style":798},[6229],{"type":382,"value":928},{"type":373,"tag":421,"props":6231,"children":6232},{"style":618},[6233],{"type":382,"value":6234}," } ",{"type":373,"tag":421,"props":6236,"children":6237},{"style":624},[6238],{"type":382,"value":627},{"type":373,"tag":421,"props":6240,"children":6241},{"style":624},[6242],{"type":382,"value":1094},{"type":373,"tag":421,"props":6244,"children":6245},{"style":618},[6246],{"type":382,"value":6247}," params;\n",{"type":373,"tag":421,"props":6249,"children":6250},{"class":423,"line":987},[6251,6255,6259,6263,6267,6271],{"type":373,"tag":421,"props":6252,"children":6253},{"style":624},[6254],{"type":382,"value":1080},{"type":373,"tag":421,"props":6256,"children":6257},{"style":798},[6258],{"type":382,"value":2052},{"type":373,"tag":421,"props":6260,"children":6261},{"style":624},[6262],{"type":382,"value":806},{"type":373,"tag":421,"props":6264,"children":6265},{"style":624},[6266],{"type":382,"value":1094},{"type":373,"tag":421,"props":6268,"children":6269},{"style":577},[6270],{"type":382,"value":1672},{"type":373,"tag":421,"props":6272,"children":6273},{"style":618},[6274],{"type":382,"value":2069},{"type":373,"tag":421,"props":6276,"children":6277},{"class":423,"line":996},[6278,6282,6287,6291,6295,6299,6304],{"type":373,"tag":421,"props":6279,"children":6280},{"style":624},[6281],{"type":382,"value":1080},{"type":373,"tag":421,"props":6283,"children":6284},{"style":798},[6285],{"type":382,"value":6286}," invoice",{"type":373,"tag":421,"props":6288,"children":6289},{"style":624},[6290],{"type":382,"value":806},{"type":373,"tag":421,"props":6292,"children":6293},{"style":624},[6294],{"type":382,"value":1094},{"type":373,"tag":421,"props":6296,"children":6297},{"style":577},[6298],{"type":382,"value":6013},{"type":373,"tag":421,"props":6300,"children":6301},{"style":618},[6302],{"type":382,"value":6303},"(org.id, id); ",{"type":373,"tag":421,"props":6305,"children":6306},{"style":609},[6307],{"type":382,"value":6308},"// commits first\n",{"type":373,"tag":421,"props":6310,"children":6311},{"class":423,"line":1004},[6312],{"type":373,"tag":421,"props":6313,"children":6314},{"emptyLinePlaceholder":779},[6315],{"type":382,"value":782},{"type":373,"tag":421,"props":6317,"children":6318},{"class":423,"line":1013},[6319,6323,6327],{"type":373,"tag":421,"props":6320,"children":6321},{"style":624},[6322],{"type":382,"value":969},{"type":373,"tag":421,"props":6324,"children":6325},{"style":577},[6326],{"type":382,"value":1429},{"type":373,"tag":421,"props":6328,"children":6329},{"style":618},[6330],{"type":382,"value":4573},{"type":373,"tag":421,"props":6332,"children":6333},{"class":423,"line":1074},[6334],{"type":373,"tag":421,"props":6335,"children":6336},{"style":618},[6337],{"type":382,"value":6338},"    org.id,\n",{"type":373,"tag":421,"props":6340,"children":6341},{"class":423,"line":1112},[6342,6347],{"type":373,"tag":421,"props":6343,"children":6344},{"style":583},[6345],{"type":382,"value":6346},"    \"invoice.paid\"",{"type":373,"tag":421,"props":6348,"children":6349},{"style":618},[6350],{"type":382,"value":838},{"type":373,"tag":421,"props":6352,"children":6353},{"class":423,"line":1164},[6354],{"type":373,"tag":421,"props":6355,"children":6356},{"style":618},[6357],{"type":382,"value":6358},"    { invoice_id: invoice.id, amount: invoice.amount, currency: invoice.currency, paid_at: invoice.paidAt },\n",{"type":373,"tag":421,"props":6360,"children":6361},{"class":423,"line":1178},[6362,6367,6372,6376,6380,6385],{"type":373,"tag":421,"props":6363,"children":6364},{"style":583},[6365],{"type":382,"value":6366},"    `invoice-paid:${",{"type":373,"tag":421,"props":6368,"children":6369},{"style":618},[6370],{"type":382,"value":6371},"invoice",{"type":373,"tag":421,"props":6373,"children":6374},{"style":583},[6375],{"type":382,"value":3920},{"type":373,"tag":421,"props":6377,"children":6378},{"style":618},[6379],{"type":382,"value":928},{"type":373,"tag":421,"props":6381,"children":6382},{"style":583},[6383],{"type":382,"value":6384},"}`",{"type":373,"tag":421,"props":6386,"children":6387},{"style":618},[6388],{"type":382,"value":838},{"type":373,"tag":421,"props":6390,"children":6391},{"class":423,"line":1186},[6392],{"type":373,"tag":421,"props":6393,"children":6394},{"style":618},[6395],{"type":382,"value":4215},{"type":373,"tag":421,"props":6397,"children":6398},{"class":423,"line":1194},[6399],{"type":373,"tag":421,"props":6400,"children":6401},{"emptyLinePlaceholder":779},[6402],{"type":382,"value":782},{"type":373,"tag":421,"props":6404,"children":6405},{"class":423,"line":1203},[6406,6410,6415,6420,6425,6429],{"type":373,"tag":421,"props":6407,"children":6408},{"style":624},[6409],{"type":382,"value":1170},{"type":373,"tag":421,"props":6411,"children":6412},{"style":618},[6413],{"type":382,"value":6414}," NextResponse.",{"type":373,"tag":421,"props":6416,"children":6417},{"style":577},[6418],{"type":382,"value":6419},"json",{"type":373,"tag":421,"props":6421,"children":6422},{"style":618},[6423],{"type":382,"value":6424},"({ ok: ",{"type":373,"tag":421,"props":6426,"children":6427},{"style":798},[6428],{"type":382,"value":2396},{"type":373,"tag":421,"props":6430,"children":6431},{"style":618},[6432],{"type":382,"value":6433}," });\n",{"type":373,"tag":421,"props":6435,"children":6436},{"class":423,"line":1244},[6437],{"type":373,"tag":421,"props":6438,"children":6439},{"style":618},[6440],{"type":382,"value":993},{"type":373,"tag":374,"props":6442,"children":6443},{},[6444,6449,6451,6457,6459,6464],{"type":373,"tag":385,"props":6445,"children":6447},{"className":6446},[],[6448],{"type":382,"value":1535},{"type":382,"value":6450}," returns as soon as Webhook Relay has stored the message (a ",{"type":373,"tag":385,"props":6452,"children":6454},{"className":6453},[],[6455],{"type":382,"value":6456},"202",{"type":382,"value":6458}," with a durable receipt), so it adds one fast API call to the request, not a delivery. If you can't afford even a lost event between commit and publish, write the event to an outbox table in the same transaction and publish from a worker; the ",{"type":373,"tag":396,"props":6460,"children":6461},{"href":206},[6462],{"type":382,"value":6463},"Go tutorial",{"type":382,"value":6465}," shows the pattern.",{"type":373,"tag":495,"props":6467,"children":6469},{"id":6468},"_6-tell-customers-how-to-verify",[6470],{"type":382,"value":6471},"6. Tell customers how to verify",{"type":373,"tag":374,"props":6473,"children":6474},{},[6475,6477,6482,6484,6490],{"type":382,"value":6476},"Link your customers to a page that explains the headers and gives them verification code. The ",{"type":373,"tag":396,"props":6478,"children":6479},{"href":71},[6480],{"type":382,"value":6481},"receiving guide",{"type":382,"value":6483}," is written for that audience and has Node.js and Go verifiers; any Standard Webhooks library works, including Svix's. Customers can test their verifier with the ",{"type":373,"tag":396,"props":6485,"children":6487},{"href":6486},"/standard-webhooks-signature-generator/",[6488],{"type":382,"value":6489},"Standard Webhooks signature generator",{"type":382,"value":3920},{"type":373,"tag":495,"props":6492,"children":6494},{"id":6493},"next-steps",[6495],{"type":382,"value":6496},"Next steps",{"type":373,"tag":502,"props":6498,"children":6499},{},[6500,6509,6526,6537],{"type":373,"tag":506,"props":6501,"children":6502},{},[6503,6507],{"type":373,"tag":396,"props":6504,"children":6505},{"href":74},[6506],{"type":382,"value":75},{"type":382,"value":6508},": statuses, health, replay after a pause and Functions that reshape a payload per customer.",{"type":373,"tag":506,"props":6510,"children":6511},{},[6512,6518,6519,6525],{"type":373,"tag":396,"props":6513,"children":6515},{"href":6514},"/docs/outbound/",[6516],{"type":382,"value":6517},"Outbound Gateway docs",{"type":382,"value":686},{"type":373,"tag":396,"props":6520,"children":6522},{"href":6521},"/outbound-webhooks/",[6523],{"type":382,"value":6524},"plans and pricing",{"type":382,"value":3920},{"type":373,"tag":506,"props":6527,"children":6528},{},[6529,6535],{"type":373,"tag":396,"props":6530,"children":6532},{"href":6531},"/blog/webhook-best-practices/",[6533],{"type":382,"value":6534},"Webhook best practices",{"type":382,"value":6536},": the checklist this setup implements.",{"type":373,"tag":506,"props":6538,"children":6539},{},[6540,6542,6547],{"type":382,"value":6541},"Migrating from another provider? See ",{"type":373,"tag":396,"props":6543,"children":6544},{"href":77},[6545],{"type":382,"value":6546},"migrate to the Outbound Gateway",{"type":382,"value":3920},{"type":373,"tag":6549,"props":6550,"children":6551},"style",{},[6552],{"type":382,"value":6553},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":345,"searchDepth":442,"depth":442,"links":6555},[6556,6557,6558,6559,6560,6561,6562,6563],{"id":497,"depth":433,"text":500},{"id":697,"depth":433,"text":700},{"id":1766,"depth":433,"text":1769},{"id":3313,"depth":433,"text":3316},{"id":4225,"depth":433,"text":4228},{"id":5886,"depth":433,"text":5889},{"id":6468,"depth":433,"text":6471},{"id":6493,"depth":433,"text":6496},"markdown","content:docs:tutorials:outbound:3.nextjs-saas-webhooks.md","content","docs/tutorials/outbound/3.nextjs-saas-webhooks.md","docs/tutorials/outbound/3.nextjs-saas-webhooks","md",{"loc":209},1792946448278]