[{"data":1,"prerenderedAt":1792},["ShallowReactive",2],{"docs-navigation":3,"content-query-48MIgNOTG7":291},[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,237,240,243,246,249,252,255,258,261,264,267,270,273,276,279,282,285,288],{"_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/clawhub","Webhook Relay on ClawHub",{"_path":20,"title":21},"/docs/email","Receive emails as webhooks",{"_path":23,"title":24},"/docs/email/payload","Email webhook payload",{"_path":26,"title":27},"/docs/email/filtering-and-policy","Sender filtering & policy",{"_path":29,"title":30},"/docs/email/cli","Create & poll email addresses from the CLI",{"_path":32,"title":33},"/docs","Getting Started",{"_path":35,"title":36},"/docs/installation/cli","CLI",{"_path":38,"title":39},"/docs/installation/docker","Docker container",{"_path":41,"title":42},"/docs/installation/docker-compose","Docker Compose",{"_path":44,"title":45},"/docs/installation/kubernetes","Kubernetes",{"_path":47,"title":48},"/docs/installation/autostart-windows","Autostart (Windows)",{"_path":50,"title":51},"/docs/installation/autostart-linux","Autostart (Linux)",{"_path":53,"title":54},"/docs/installation/autostart-macos","Autostart (MacOS)",{"_path":56,"title":57},"/docs/installation/behind-proxy","HTTP proxy configuration",{"_path":59,"title":60},"/docs/mcp","MCP Server",{"_path":62,"title":63},"/docs/security","Security & Tech",{"_path":65,"title":66},"/docs/service-connections","Service Connections",{"_path":68,"title":69},"/docs/service-connections/aws_s3","AWS S3",{"_path":71,"title":72},"/docs/service-connections/aws_sns","AWS SNS",{"_path":74,"title":75},"/docs/service-connections/aws_sqs","AWS SQS",{"_path":77,"title":78},"/docs/service-connections/azure","Azure",{"_path":80,"title":81},"/docs/service-connections/gcp_gcs","GCP Cloud Storage",{"_path":83,"title":84},"/docs/service-connections/gcp_pubsub","GCP Pub/Sub",{"_path":86,"title":87},"/docs/service-connections/secrets","Secrets",{"_path":89,"title":90},"/docs/skills","Agent Skills",{"_path":92,"title":93},"/docs/skills-cli","skills.sh — the Agent Skills CLI",{"_path":95,"title":96},"/docs/tunnels/demoing-your-website","Demoing your website",{"_path":98,"title":99},"/docs/tunnels/regions","Regions",{"_path":101,"title":102},"/docs/tutorials/cicd/jenkins-bitbucket","Jenkins and Bitbucket",{"_path":104,"title":105},"/docs/tutorials/cicd/jenkins-github","Jenkins and GitHub",{"_path":107,"title":108},"/docs/tutorials/cicd/jenkins-plugin","Jenkins Plugin",{"_path":110,"title":111},"/docs/tutorials/cicd/jenkins-plugin-multibranch","Jenkins Multibranch Pipelines",{"_path":113,"title":114},"/docs/tutorials/cicd/kubernetes-operator","Kubernetes Operator",{"_path":116,"title":117},"/docs/tutorials/cicd/terraform-atlantis","Terraform Atlantis",{"_path":119,"title":120},"/docs/tutorials/cicd/webhook-exec","Execute scripts on webhook",{"_path":122,"title":123},"/docs/tutorials/edge/home-assistant","Home Assistant",{"_path":125,"title":126},"/docs/tutorials/edge/javascript-app","JavaScript app",{"_path":128,"title":129},"/docs/tutorials/edge/node-red","Node-RED",{"_path":131,"title":132},"/docs/tutorials/email/airtable","Email to Airtable",{"_path":134,"title":135},"/docs/tutorials/email/api","Email to API",{"_path":137,"title":138},"/docs/tutorials/email/database","Email to Database",{"_path":140,"title":141},"/docs/tutorials/email/discord","Email to Discord",{"_path":143,"title":144},"/docs/tutorials/email/google-sheets","Email to Google Sheets",{"_path":146,"title":147},"/docs/tutorials/email/microsoft-teams","Email to Microsoft Teams",{"_path":149,"title":150},"/docs/tutorials/email/notion","Email to Notion",{"_path":152,"title":153},"/docs/tutorials/email/slack","Email to Slack",{"_path":155,"title":156},"/docs/tutorials","Tutorials",{"_path":158,"title":159},"/docs/tutorials/n8n/email-trigger","n8n Email Trigger (Inbound Email)",{"_path":161,"title":162},"/docs/tutorials/n8n/webhook-trigger","n8n Webhook Trigger (No Public IP)",{"_path":164,"title":165},"/docs/tutorials/n8n/whatsapp-cloud-api-webhook","n8n WhatsApp Cloud API Webhook Setup",{"_path":167,"title":168},"/docs/tutorials/transform/docker-to-slack","DockerHub webhook to Slack notification",{"_path":170,"title":171},"/docs/tutorials/transform/enrich-webhooks","Enrich webhooks from APIs",{"_path":173,"title":174},"/docs/tutorials/warehouse/bigquery","GCP BigQuery",{"_path":176,"title":177},"/docs/webhooks/alerts","Alerts",{"_path":179,"title":180},"/docs/webhooks/auth/username-password","Username and password",{"_path":182,"title":183},"/docs/webhooks/auth/hmac","HMAC",{"_path":185,"title":186},"/docs/webhooks/auth/jwt","JWT authentication",{"_path":188,"title":189},"/docs/webhooks/auth/http-method","Auth using request method",{"_path":191,"title":192},"/docs/webhooks/cors","CORS for webhooks",{"_path":194,"title":195},"/docs/webhooks/cron/using-cron-webhooks","Schedule recurring webhooks",{"_path":197,"title":198},"/docs/webhooks/custom-domains","Custom webhook domains",{"_path":200,"title":201},"/docs/webhooks/custom-subdomains","Custom webhook subdomains",{"_path":203,"title":204},"/docs/webhooks/custom-webhook-response","Custom response to webhooks",{"_path":206,"title":207},"/docs/webhooks/durable-webhooks","Durable webhooks: reliable delivery with automatic retries",{"_path":209,"title":210},"/docs/webhooks/functions/manipulating-json","JSON encoding",{"_path":212,"title":213},"/docs/webhooks/functions/make-http-request","Make HTTP request",{"_path":215,"title":216},"/docs/webhooks/functions/modify-request","Modify webhook headers, body, method and path",{"_path":218,"title":219},"/docs/webhooks/functions/multipart-form-data","Multipart form to JSON",{"_path":221,"title":222},"/docs/webhooks/functions/url-encoded-data","URL Encoded Form",{"_path":224,"title":225},"/docs/webhooks/functions/working-with-time","Working with time",{"_path":227,"title":228},"/docs/webhooks/functions/send-emails","Sending emails",{"_path":230,"title":231},"/docs/webhooks/functions/crypto-functions","Base64, encryption",{"_path":233,"title":234},"/docs/webhooks/functions/integrate-into-cicd","Integrating into CI/CD",{"_path":236,"title":174},"/docs/webhooks/functions/big-query",{"_path":238,"title":239},"/docs/webhooks/functions/accessing-metadata","Accessing metadata",{"_path":241,"title":242},"/docs/webhooks/functions/response-functions","Response (post-delivery) functions",{"_path":244,"title":245},"/docs/webhooks/functions/alerting","Alerting from functions",{"_path":247,"title":248},"/docs/webhooks/functions/helper-libraries","Helper libraries",{"_path":250,"title":251},"/docs/webhooks/functions/transform-webhook-payload","Transform a webhook payload",{"_path":253,"title":254},"/docs/webhooks/functions/filter-webhooks","Filter or drop webhooks before forwarding",{"_path":256,"title":257},"/docs/webhooks/functions","Webhook transformations (functions): modify body, headers, method and path",{"_path":259,"title":260},"/docs/webhooks/internal/localhost","Receive webhooks on localhost with the relay CLI",{"_path":262,"title":263},"/docs/webhooks/large-webhooks","Large Webhooks",{"_path":265,"title":266},"/docs/webhooks/outbound-throttling","Outbound throttling: control webhook delivery speed",{"_path":268,"title":269},"/docs/webhooks/polling-webhooks","Polling webhooks with /v1/events",{"_path":271,"title":272},"/docs/webhooks/public/public-destination","Forward to public URL",{"_path":274,"title":275},"/docs/webhooks/public/multiple-destination-urls","Forward webhooks to multiple destinations",{"_path":277,"title":278},"/docs/webhooks/replay-on-agent-connect","Webhook replay on agent connect: recover missed webhooks",{"_path":280,"title":281},"/docs/webhooks/static-ip-address","Static IP Address",{"_path":283,"title":284},"/docs/webhooks/tls-ssl-errors","Fix TLS/SSL handshake errors: unsupported protocol, wrong version number, handshake failure",{"_path":286,"title":287},"/docs/webhooks/websocket-server","Connecting to websocket server",{"_path":289,"title":290},"/docs/webhooks/zero-retention-buckets","Zero Retention Buckets",{"_path":250,"_dir":292,"_draft":293,"_partial":293,"_locale":294,"title":251,"description":295,"intro":296,"type":297,"section":292,"level":298,"layout":299,"tags":300,"faq":303,"body":316,"_type":1785,"_id":1786,"_source":1787,"_file":1788,"_stem":1789,"_extension":1790,"sitemap":1791},"functions",false,"","Reshape a webhook's JSON body before forwarding it: rename and map fields, flatten nested objects, convert one provider's event into the format another API or chat tool expects, using a JavaScript function.","Map, rename, flatten and convert webhook JSON in flight so a destination receives exactly the shape it expects.","example","beginner","doc",[301,302],"Functions","Transform",[304,307,310,313],{"q":305,"a":306},"How do I change the JSON body of a webhook before forwarding it?","Attach a function to the output. Parse r.body with JSON.parse, build the new object, and call r.setBody(JSON.stringify(newObject)). Set Content-Type with r.setHeader if the destination needs it. Webhook Relay forwards the new body; the provider never knows.",{"q":308,"a":309},"Can I map fields from one provider's format to another service's API?","Yes. That is the main use: read the fields you need from the incoming event, write them into the field names the destination expects, and drop the rest. Helper libraries provide JMESPath for deep lookups and Mustache templates for text bodies.",{"q":311,"a":312},"Does the transformation run before or after retries?","Before delivery, on every attempt. If the destination fails, the retry sends the transformed request again. The original incoming request stays in the logs unchanged, so you can inspect what the provider actually sent.",{"q":314,"a":315},"Can one webhook be transformed differently for different destinations?","Yes. Attach a different function to each output on the bucket. The same incoming event can become a Slack message on one output, a normalised JSON document on another, and pass through untouched on a third.",{"type":317,"children":318,"toc":1777},"root",[319,333,340,362,1024,1030,1043,1246,1259,1265,1270,1501,1536,1542,1576,1582,1587,1706,1712,1740,1771],{"type":320,"tag":321,"props":322,"children":323},"element","p",{},[324,331],{"type":320,"tag":325,"props":326,"children":327},"strong",{},[328],{"type":329,"value":330},"text","To transform a webhook payload, attach a function to the output: parse the incoming body, build the object the destination expects, and set it as the new body.",{"type":329,"value":332}," The function runs on Webhook Relay before every delivery attempt, so there is nothing to host and the provider keeps sending its normal webhook.",{"type":320,"tag":334,"props":335,"children":337},"h2",{"id":336},"rename-and-map-fields",[338],{"type":329,"value":339},"Rename and map fields",{"type":320,"tag":321,"props":341,"children":342},{},[343,345,352,354,360],{"type":329,"value":344},"A provider sends ",{"type":320,"tag":346,"props":347,"children":349},"code",{"className":348},[],[350],{"type":329,"value":351},"{ \"event\": \"order.paid\", \"order\": { \"id\": \"o_1\", \"total_cents\": 4990 } }",{"type":329,"value":353},"; the destination wants ",{"type":320,"tag":346,"props":355,"children":357},{"className":356},[],[358],{"type":329,"value":359},"{ \"type\": \"...\", \"orderId\": \"...\", \"amount\": 49.90 }",{"type":329,"value":361},".",{"type":320,"tag":363,"props":364,"children":365},"code-switcher",{},[366,625],{"type":320,"tag":367,"props":368,"children":369},"template",{"v-slot:javascript":294},[370],{"type":320,"tag":371,"props":372,"children":376},"pre",{"className":373,"code":374,"language":375,"meta":294,"style":294},"language-javascript shiki shiki-themes github-dark","const incoming = JSON.parse(r.body)\n\nconst outgoing = {\n  type: incoming.event,\n  orderId: incoming.order.id,\n  amount: incoming.order.total_cents / 100,\n  receivedAt: new Date().toISOString(),\n}\n\nr.setBody(JSON.stringify(outgoing))\nr.setHeader(\"Content-Type\", \"application/json\")\n","javascript",[377],{"type":320,"tag":346,"props":378,"children":379},{"__ignoreMap":294},[380,424,434,456,465,474,498,532,541,549,587],{"type":320,"tag":381,"props":382,"children":385},"span",{"class":383,"line":384},"line",1,[386,392,398,403,408,413,419],{"type":320,"tag":381,"props":387,"children":389},{"style":388},"--shiki-default:#F97583",[390],{"type":329,"value":391},"const",{"type":320,"tag":381,"props":393,"children":395},{"style":394},"--shiki-default:#79B8FF",[396],{"type":329,"value":397}," incoming",{"type":320,"tag":381,"props":399,"children":400},{"style":388},[401],{"type":329,"value":402}," =",{"type":320,"tag":381,"props":404,"children":405},{"style":394},[406],{"type":329,"value":407}," JSON",{"type":320,"tag":381,"props":409,"children":411},{"style":410},"--shiki-default:#E1E4E8",[412],{"type":329,"value":361},{"type":320,"tag":381,"props":414,"children":416},{"style":415},"--shiki-default:#B392F0",[417],{"type":329,"value":418},"parse",{"type":320,"tag":381,"props":420,"children":421},{"style":410},[422],{"type":329,"value":423},"(r.body)\n",{"type":320,"tag":381,"props":425,"children":427},{"class":383,"line":426},2,[428],{"type":320,"tag":381,"props":429,"children":431},{"emptyLinePlaceholder":430},true,[432],{"type":329,"value":433},"\n",{"type":320,"tag":381,"props":435,"children":437},{"class":383,"line":436},3,[438,442,447,451],{"type":320,"tag":381,"props":439,"children":440},{"style":388},[441],{"type":329,"value":391},{"type":320,"tag":381,"props":443,"children":444},{"style":394},[445],{"type":329,"value":446}," outgoing",{"type":320,"tag":381,"props":448,"children":449},{"style":388},[450],{"type":329,"value":402},{"type":320,"tag":381,"props":452,"children":453},{"style":410},[454],{"type":329,"value":455}," {\n",{"type":320,"tag":381,"props":457,"children":459},{"class":383,"line":458},4,[460],{"type":320,"tag":381,"props":461,"children":462},{"style":410},[463],{"type":329,"value":464},"  type: incoming.event,\n",{"type":320,"tag":381,"props":466,"children":468},{"class":383,"line":467},5,[469],{"type":320,"tag":381,"props":470,"children":471},{"style":410},[472],{"type":329,"value":473},"  orderId: incoming.order.id,\n",{"type":320,"tag":381,"props":475,"children":477},{"class":383,"line":476},6,[478,483,488,493],{"type":320,"tag":381,"props":479,"children":480},{"style":410},[481],{"type":329,"value":482},"  amount: incoming.order.total_cents ",{"type":320,"tag":381,"props":484,"children":485},{"style":388},[486],{"type":329,"value":487},"/",{"type":320,"tag":381,"props":489,"children":490},{"style":394},[491],{"type":329,"value":492}," 100",{"type":320,"tag":381,"props":494,"children":495},{"style":410},[496],{"type":329,"value":497},",\n",{"type":320,"tag":381,"props":499,"children":501},{"class":383,"line":500},7,[502,507,512,517,522,527],{"type":320,"tag":381,"props":503,"children":504},{"style":410},[505],{"type":329,"value":506},"  receivedAt: ",{"type":320,"tag":381,"props":508,"children":509},{"style":388},[510],{"type":329,"value":511},"new",{"type":320,"tag":381,"props":513,"children":514},{"style":415},[515],{"type":329,"value":516}," Date",{"type":320,"tag":381,"props":518,"children":519},{"style":410},[520],{"type":329,"value":521},"().",{"type":320,"tag":381,"props":523,"children":524},{"style":415},[525],{"type":329,"value":526},"toISOString",{"type":320,"tag":381,"props":528,"children":529},{"style":410},[530],{"type":329,"value":531},"(),\n",{"type":320,"tag":381,"props":533,"children":535},{"class":383,"line":534},8,[536],{"type":320,"tag":381,"props":537,"children":538},{"style":410},[539],{"type":329,"value":540},"}\n",{"type":320,"tag":381,"props":542,"children":544},{"class":383,"line":543},9,[545],{"type":320,"tag":381,"props":546,"children":547},{"emptyLinePlaceholder":430},[548],{"type":329,"value":433},{"type":320,"tag":381,"props":550,"children":552},{"class":383,"line":551},10,[553,558,563,568,573,577,582],{"type":320,"tag":381,"props":554,"children":555},{"style":410},[556],{"type":329,"value":557},"r.",{"type":320,"tag":381,"props":559,"children":560},{"style":415},[561],{"type":329,"value":562},"setBody",{"type":320,"tag":381,"props":564,"children":565},{"style":410},[566],{"type":329,"value":567},"(",{"type":320,"tag":381,"props":569,"children":570},{"style":394},[571],{"type":329,"value":572},"JSON",{"type":320,"tag":381,"props":574,"children":575},{"style":410},[576],{"type":329,"value":361},{"type":320,"tag":381,"props":578,"children":579},{"style":415},[580],{"type":329,"value":581},"stringify",{"type":320,"tag":381,"props":583,"children":584},{"style":410},[585],{"type":329,"value":586},"(outgoing))\n",{"type":320,"tag":381,"props":588,"children":590},{"class":383,"line":589},11,[591,595,600,604,610,615,620],{"type":320,"tag":381,"props":592,"children":593},{"style":410},[594],{"type":329,"value":557},{"type":320,"tag":381,"props":596,"children":597},{"style":415},[598],{"type":329,"value":599},"setHeader",{"type":320,"tag":381,"props":601,"children":602},{"style":410},[603],{"type":329,"value":567},{"type":320,"tag":381,"props":605,"children":607},{"style":606},"--shiki-default:#9ECBFF",[608],{"type":329,"value":609},"\"Content-Type\"",{"type":320,"tag":381,"props":611,"children":612},{"style":410},[613],{"type":329,"value":614},", ",{"type":320,"tag":381,"props":616,"children":617},{"style":606},[618],{"type":329,"value":619},"\"application/json\"",{"type":320,"tag":381,"props":621,"children":622},{"style":410},[623],{"type":329,"value":624},")\n",{"type":320,"tag":367,"props":626,"children":627},{"v-slot:lua":294},[628],{"type":320,"tag":371,"props":629,"children":633},{"className":630,"code":631,"language":632,"meta":294,"style":294},"language-lua shiki shiki-themes github-dark","local json = require(\"json\")\n\nlocal incoming, err = json.decode(r.RequestBody)\nif err then error(err) end\n\nlocal outgoing = {\n  type = incoming.event,\n  orderId = incoming.order.id,\n  amount = incoming.order.total_cents / 100,\n}\n\nlocal body, err = json.encode(outgoing)\nif err then error(err) end\n\nr:SetRequestBody(body)\nr:SetRequestHeader(\"Content-Type\", \"application/json\")\n","lua",[634],{"type":320,"tag":346,"props":635,"children":636},{"__ignoreMap":294},[637,673,680,720,753,760,780,806,840,882,889,896,927,955,963,987],{"type":320,"tag":381,"props":638,"children":639},{"class":383,"line":384},[640,645,650,655,660,664,669],{"type":320,"tag":381,"props":641,"children":642},{"style":388},[643],{"type":329,"value":644},"local",{"type":320,"tag":381,"props":646,"children":647},{"style":410},[648],{"type":329,"value":649}," json ",{"type":320,"tag":381,"props":651,"children":652},{"style":388},[653],{"type":329,"value":654},"=",{"type":320,"tag":381,"props":656,"children":657},{"style":394},[658],{"type":329,"value":659}," require",{"type":320,"tag":381,"props":661,"children":662},{"style":410},[663],{"type":329,"value":567},{"type":320,"tag":381,"props":665,"children":666},{"style":606},[667],{"type":329,"value":668},"\"json\"",{"type":320,"tag":381,"props":670,"children":671},{"style":410},[672],{"type":329,"value":624},{"type":320,"tag":381,"props":674,"children":675},{"class":383,"line":426},[676],{"type":320,"tag":381,"props":677,"children":678},{"emptyLinePlaceholder":430},[679],{"type":329,"value":433},{"type":320,"tag":381,"props":681,"children":682},{"class":383,"line":436},[683,687,692,696,701,706,711,716],{"type":320,"tag":381,"props":684,"children":685},{"style":388},[686],{"type":329,"value":644},{"type":320,"tag":381,"props":688,"children":689},{"style":410},[690],{"type":329,"value":691}," incoming, err ",{"type":320,"tag":381,"props":693,"children":694},{"style":388},[695],{"type":329,"value":654},{"type":320,"tag":381,"props":697,"children":698},{"style":410},[699],{"type":329,"value":700}," json.",{"type":320,"tag":381,"props":702,"children":703},{"style":394},[704],{"type":329,"value":705},"decode",{"type":320,"tag":381,"props":707,"children":708},{"style":410},[709],{"type":329,"value":710},"(r.",{"type":320,"tag":381,"props":712,"children":713},{"style":415},[714],{"type":329,"value":715},"RequestBody",{"type":320,"tag":381,"props":717,"children":718},{"style":410},[719],{"type":329,"value":624},{"type":320,"tag":381,"props":721,"children":722},{"class":383,"line":458},[723,728,733,738,743,748],{"type":320,"tag":381,"props":724,"children":725},{"style":388},[726],{"type":329,"value":727},"if",{"type":320,"tag":381,"props":729,"children":730},{"style":410},[731],{"type":329,"value":732}," err ",{"type":320,"tag":381,"props":734,"children":735},{"style":388},[736],{"type":329,"value":737},"then",{"type":320,"tag":381,"props":739,"children":740},{"style":394},[741],{"type":329,"value":742}," error",{"type":320,"tag":381,"props":744,"children":745},{"style":410},[746],{"type":329,"value":747},"(err) ",{"type":320,"tag":381,"props":749,"children":750},{"style":388},[751],{"type":329,"value":752},"end\n",{"type":320,"tag":381,"props":754,"children":755},{"class":383,"line":467},[756],{"type":320,"tag":381,"props":757,"children":758},{"emptyLinePlaceholder":430},[759],{"type":329,"value":433},{"type":320,"tag":381,"props":761,"children":762},{"class":383,"line":476},[763,767,772,776],{"type":320,"tag":381,"props":764,"children":765},{"style":388},[766],{"type":329,"value":644},{"type":320,"tag":381,"props":768,"children":769},{"style":410},[770],{"type":329,"value":771}," outgoing ",{"type":320,"tag":381,"props":773,"children":774},{"style":388},[775],{"type":329,"value":654},{"type":320,"tag":381,"props":777,"children":778},{"style":410},[779],{"type":329,"value":455},{"type":320,"tag":381,"props":781,"children":782},{"class":383,"line":500},[783,788,792,797,802],{"type":320,"tag":381,"props":784,"children":785},{"style":410},[786],{"type":329,"value":787},"  type ",{"type":320,"tag":381,"props":789,"children":790},{"style":388},[791],{"type":329,"value":654},{"type":320,"tag":381,"props":793,"children":794},{"style":410},[795],{"type":329,"value":796}," incoming.",{"type":320,"tag":381,"props":798,"children":799},{"style":415},[800],{"type":329,"value":801},"event",{"type":320,"tag":381,"props":803,"children":804},{"style":410},[805],{"type":329,"value":497},{"type":320,"tag":381,"props":807,"children":808},{"class":383,"line":534},[809,814,818,822,827,831,836],{"type":320,"tag":381,"props":810,"children":811},{"style":410},[812],{"type":329,"value":813},"  orderId ",{"type":320,"tag":381,"props":815,"children":816},{"style":388},[817],{"type":329,"value":654},{"type":320,"tag":381,"props":819,"children":820},{"style":410},[821],{"type":329,"value":796},{"type":320,"tag":381,"props":823,"children":824},{"style":415},[825],{"type":329,"value":826},"order",{"type":320,"tag":381,"props":828,"children":829},{"style":410},[830],{"type":329,"value":361},{"type":320,"tag":381,"props":832,"children":833},{"style":415},[834],{"type":329,"value":835},"id",{"type":320,"tag":381,"props":837,"children":838},{"style":410},[839],{"type":329,"value":497},{"type":320,"tag":381,"props":841,"children":842},{"class":383,"line":543},[843,848,852,856,860,864,869,874,878],{"type":320,"tag":381,"props":844,"children":845},{"style":410},[846],{"type":329,"value":847},"  amount ",{"type":320,"tag":381,"props":849,"children":850},{"style":388},[851],{"type":329,"value":654},{"type":320,"tag":381,"props":853,"children":854},{"style":410},[855],{"type":329,"value":796},{"type":320,"tag":381,"props":857,"children":858},{"style":415},[859],{"type":329,"value":826},{"type":320,"tag":381,"props":861,"children":862},{"style":410},[863],{"type":329,"value":361},{"type":320,"tag":381,"props":865,"children":866},{"style":415},[867],{"type":329,"value":868},"total_cents",{"type":320,"tag":381,"props":870,"children":871},{"style":388},[872],{"type":329,"value":873}," /",{"type":320,"tag":381,"props":875,"children":876},{"style":394},[877],{"type":329,"value":492},{"type":320,"tag":381,"props":879,"children":880},{"style":410},[881],{"type":329,"value":497},{"type":320,"tag":381,"props":883,"children":884},{"class":383,"line":551},[885],{"type":320,"tag":381,"props":886,"children":887},{"style":410},[888],{"type":329,"value":540},{"type":320,"tag":381,"props":890,"children":891},{"class":383,"line":589},[892],{"type":320,"tag":381,"props":893,"children":894},{"emptyLinePlaceholder":430},[895],{"type":329,"value":433},{"type":320,"tag":381,"props":897,"children":899},{"class":383,"line":898},12,[900,904,909,913,917,922],{"type":320,"tag":381,"props":901,"children":902},{"style":388},[903],{"type":329,"value":644},{"type":320,"tag":381,"props":905,"children":906},{"style":410},[907],{"type":329,"value":908}," body, err ",{"type":320,"tag":381,"props":910,"children":911},{"style":388},[912],{"type":329,"value":654},{"type":320,"tag":381,"props":914,"children":915},{"style":410},[916],{"type":329,"value":700},{"type":320,"tag":381,"props":918,"children":919},{"style":394},[920],{"type":329,"value":921},"encode",{"type":320,"tag":381,"props":923,"children":924},{"style":410},[925],{"type":329,"value":926},"(outgoing)\n",{"type":320,"tag":381,"props":928,"children":930},{"class":383,"line":929},13,[931,935,939,943,947,951],{"type":320,"tag":381,"props":932,"children":933},{"style":388},[934],{"type":329,"value":727},{"type":320,"tag":381,"props":936,"children":937},{"style":410},[938],{"type":329,"value":732},{"type":320,"tag":381,"props":940,"children":941},{"style":388},[942],{"type":329,"value":737},{"type":320,"tag":381,"props":944,"children":945},{"style":394},[946],{"type":329,"value":742},{"type":320,"tag":381,"props":948,"children":949},{"style":410},[950],{"type":329,"value":747},{"type":320,"tag":381,"props":952,"children":953},{"style":388},[954],{"type":329,"value":752},{"type":320,"tag":381,"props":956,"children":958},{"class":383,"line":957},14,[959],{"type":320,"tag":381,"props":960,"children":961},{"emptyLinePlaceholder":430},[962],{"type":329,"value":433},{"type":320,"tag":381,"props":964,"children":966},{"class":383,"line":965},15,[967,972,977,982],{"type":320,"tag":381,"props":968,"children":969},{"style":415},[970],{"type":329,"value":971},"r",{"type":320,"tag":381,"props":973,"children":974},{"style":410},[975],{"type":329,"value":976},":",{"type":320,"tag":381,"props":978,"children":979},{"style":394},[980],{"type":329,"value":981},"SetRequestBody",{"type":320,"tag":381,"props":983,"children":984},{"style":410},[985],{"type":329,"value":986},"(body)\n",{"type":320,"tag":381,"props":988,"children":990},{"class":383,"line":989},16,[991,995,999,1004,1008,1012,1016,1020],{"type":320,"tag":381,"props":992,"children":993},{"style":415},[994],{"type":329,"value":971},{"type":320,"tag":381,"props":996,"children":997},{"style":410},[998],{"type":329,"value":976},{"type":320,"tag":381,"props":1000,"children":1001},{"style":394},[1002],{"type":329,"value":1003},"SetRequestHeader",{"type":320,"tag":381,"props":1005,"children":1006},{"style":410},[1007],{"type":329,"value":567},{"type":320,"tag":381,"props":1009,"children":1010},{"style":606},[1011],{"type":329,"value":609},{"type":320,"tag":381,"props":1013,"children":1014},{"style":410},[1015],{"type":329,"value":614},{"type":320,"tag":381,"props":1017,"children":1018},{"style":606},[1019],{"type":329,"value":619},{"type":320,"tag":381,"props":1021,"children":1022},{"style":410},[1023],{"type":329,"value":624},{"type":320,"tag":334,"props":1025,"children":1027},{"id":1026},"flatten-nested-objects-and-pick-fields-with-jmespath",[1028],{"type":329,"value":1029},"Flatten nested objects and pick fields with JMESPath",{"type":320,"tag":321,"props":1031,"children":1032},{},[1033,1035,1041],{"type":329,"value":1034},"For deeply nested provider payloads, the ",{"type":320,"tag":346,"props":1036,"children":1038},{"className":1037},[],[1039],{"type":329,"value":1040},"jmespath",{"type":329,"value":1042}," helper library extracts values with a query instead of chained property access:",{"type":320,"tag":371,"props":1044,"children":1046},{"className":373,"code":1045,"language":375,"meta":294,"style":294},"const jmespath = require(\"jmespath\")\nconst event = JSON.parse(r.body)\n\nr.setBody(JSON.stringify({\n  customer: jmespath.search(event, \"data.object.customer_details.email\"),\n  items: jmespath.search(event, \"data.object.lines.data[].{sku: price.product, qty: quantity}\"),\n}))\nr.setHeader(\"Content-Type\", \"application/json\")\n",[1047],{"type":320,"tag":346,"props":1048,"children":1049},{"__ignoreMap":294},[1050,1083,1115,1122,1154,1182,1207,1215],{"type":320,"tag":381,"props":1051,"children":1052},{"class":383,"line":384},[1053,1057,1062,1066,1070,1074,1079],{"type":320,"tag":381,"props":1054,"children":1055},{"style":388},[1056],{"type":329,"value":391},{"type":320,"tag":381,"props":1058,"children":1059},{"style":394},[1060],{"type":329,"value":1061}," jmespath",{"type":320,"tag":381,"props":1063,"children":1064},{"style":388},[1065],{"type":329,"value":402},{"type":320,"tag":381,"props":1067,"children":1068},{"style":415},[1069],{"type":329,"value":659},{"type":320,"tag":381,"props":1071,"children":1072},{"style":410},[1073],{"type":329,"value":567},{"type":320,"tag":381,"props":1075,"children":1076},{"style":606},[1077],{"type":329,"value":1078},"\"jmespath\"",{"type":320,"tag":381,"props":1080,"children":1081},{"style":410},[1082],{"type":329,"value":624},{"type":320,"tag":381,"props":1084,"children":1085},{"class":383,"line":426},[1086,1090,1095,1099,1103,1107,1111],{"type":320,"tag":381,"props":1087,"children":1088},{"style":388},[1089],{"type":329,"value":391},{"type":320,"tag":381,"props":1091,"children":1092},{"style":394},[1093],{"type":329,"value":1094}," event",{"type":320,"tag":381,"props":1096,"children":1097},{"style":388},[1098],{"type":329,"value":402},{"type":320,"tag":381,"props":1100,"children":1101},{"style":394},[1102],{"type":329,"value":407},{"type":320,"tag":381,"props":1104,"children":1105},{"style":410},[1106],{"type":329,"value":361},{"type":320,"tag":381,"props":1108,"children":1109},{"style":415},[1110],{"type":329,"value":418},{"type":320,"tag":381,"props":1112,"children":1113},{"style":410},[1114],{"type":329,"value":423},{"type":320,"tag":381,"props":1116,"children":1117},{"class":383,"line":436},[1118],{"type":320,"tag":381,"props":1119,"children":1120},{"emptyLinePlaceholder":430},[1121],{"type":329,"value":433},{"type":320,"tag":381,"props":1123,"children":1124},{"class":383,"line":458},[1125,1129,1133,1137,1141,1145,1149],{"type":320,"tag":381,"props":1126,"children":1127},{"style":410},[1128],{"type":329,"value":557},{"type":320,"tag":381,"props":1130,"children":1131},{"style":415},[1132],{"type":329,"value":562},{"type":320,"tag":381,"props":1134,"children":1135},{"style":410},[1136],{"type":329,"value":567},{"type":320,"tag":381,"props":1138,"children":1139},{"style":394},[1140],{"type":329,"value":572},{"type":320,"tag":381,"props":1142,"children":1143},{"style":410},[1144],{"type":329,"value":361},{"type":320,"tag":381,"props":1146,"children":1147},{"style":415},[1148],{"type":329,"value":581},{"type":320,"tag":381,"props":1150,"children":1151},{"style":410},[1152],{"type":329,"value":1153},"({\n",{"type":320,"tag":381,"props":1155,"children":1156},{"class":383,"line":467},[1157,1162,1167,1172,1177],{"type":320,"tag":381,"props":1158,"children":1159},{"style":410},[1160],{"type":329,"value":1161},"  customer: jmespath.",{"type":320,"tag":381,"props":1163,"children":1164},{"style":415},[1165],{"type":329,"value":1166},"search",{"type":320,"tag":381,"props":1168,"children":1169},{"style":410},[1170],{"type":329,"value":1171},"(event, ",{"type":320,"tag":381,"props":1173,"children":1174},{"style":606},[1175],{"type":329,"value":1176},"\"data.object.customer_details.email\"",{"type":320,"tag":381,"props":1178,"children":1179},{"style":410},[1180],{"type":329,"value":1181},"),\n",{"type":320,"tag":381,"props":1183,"children":1184},{"class":383,"line":476},[1185,1190,1194,1198,1203],{"type":320,"tag":381,"props":1186,"children":1187},{"style":410},[1188],{"type":329,"value":1189},"  items: jmespath.",{"type":320,"tag":381,"props":1191,"children":1192},{"style":415},[1193],{"type":329,"value":1166},{"type":320,"tag":381,"props":1195,"children":1196},{"style":410},[1197],{"type":329,"value":1171},{"type":320,"tag":381,"props":1199,"children":1200},{"style":606},[1201],{"type":329,"value":1202},"\"data.object.lines.data[].{sku: price.product, qty: quantity}\"",{"type":320,"tag":381,"props":1204,"children":1205},{"style":410},[1206],{"type":329,"value":1181},{"type":320,"tag":381,"props":1208,"children":1209},{"class":383,"line":500},[1210],{"type":320,"tag":381,"props":1211,"children":1212},{"style":410},[1213],{"type":329,"value":1214},"}))\n",{"type":320,"tag":381,"props":1216,"children":1217},{"class":383,"line":534},[1218,1222,1226,1230,1234,1238,1242],{"type":320,"tag":381,"props":1219,"children":1220},{"style":410},[1221],{"type":329,"value":557},{"type":320,"tag":381,"props":1223,"children":1224},{"style":415},[1225],{"type":329,"value":599},{"type":320,"tag":381,"props":1227,"children":1228},{"style":410},[1229],{"type":329,"value":567},{"type":320,"tag":381,"props":1231,"children":1232},{"style":606},[1233],{"type":329,"value":609},{"type":320,"tag":381,"props":1235,"children":1236},{"style":410},[1237],{"type":329,"value":614},{"type":320,"tag":381,"props":1239,"children":1240},{"style":606},[1241],{"type":329,"value":619},{"type":320,"tag":381,"props":1243,"children":1244},{"style":410},[1245],{"type":329,"value":624},{"type":320,"tag":321,"props":1247,"children":1248},{},[1249,1251,1257],{"type":329,"value":1250},"See ",{"type":320,"tag":1252,"props":1253,"children":1254},"a",{"href":247},[1255],{"type":329,"value":1256},"helper libraries",{"type":329,"value":1258}," for JMESPath, CSV, XML, YAML and templating modules.",{"type":320,"tag":334,"props":1260,"children":1262},{"id":1261},"convert-to-a-chat-message-slack-discord-teams",[1263],{"type":329,"value":1264},"Convert to a chat message (Slack, Discord, Teams)",{"type":320,"tag":321,"props":1266,"children":1267},{},[1268],{"type":329,"value":1269},"Chat tools accept only their own message format. Build it from the event:",{"type":320,"tag":371,"props":1271,"children":1273},{"className":373,"code":1272,"language":375,"meta":294,"style":294},"const event = JSON.parse(r.body)\n\nr.setBody(JSON.stringify({\n  text: `New ${event.event}: order ${event.order.id} for ${event.order.total_cents / 100}`,\n}))\nr.setHeader(\"Content-Type\", \"application/json\")\nr.setMethod(\"POST\")\n",[1274],{"type":320,"tag":346,"props":1275,"children":1276},{"__ignoreMap":294},[1277,1308,1315,1346,1438,1445,1476],{"type":320,"tag":381,"props":1278,"children":1279},{"class":383,"line":384},[1280,1284,1288,1292,1296,1300,1304],{"type":320,"tag":381,"props":1281,"children":1282},{"style":388},[1283],{"type":329,"value":391},{"type":320,"tag":381,"props":1285,"children":1286},{"style":394},[1287],{"type":329,"value":1094},{"type":320,"tag":381,"props":1289,"children":1290},{"style":388},[1291],{"type":329,"value":402},{"type":320,"tag":381,"props":1293,"children":1294},{"style":394},[1295],{"type":329,"value":407},{"type":320,"tag":381,"props":1297,"children":1298},{"style":410},[1299],{"type":329,"value":361},{"type":320,"tag":381,"props":1301,"children":1302},{"style":415},[1303],{"type":329,"value":418},{"type":320,"tag":381,"props":1305,"children":1306},{"style":410},[1307],{"type":329,"value":423},{"type":320,"tag":381,"props":1309,"children":1310},{"class":383,"line":426},[1311],{"type":320,"tag":381,"props":1312,"children":1313},{"emptyLinePlaceholder":430},[1314],{"type":329,"value":433},{"type":320,"tag":381,"props":1316,"children":1317},{"class":383,"line":436},[1318,1322,1326,1330,1334,1338,1342],{"type":320,"tag":381,"props":1319,"children":1320},{"style":410},[1321],{"type":329,"value":557},{"type":320,"tag":381,"props":1323,"children":1324},{"style":415},[1325],{"type":329,"value":562},{"type":320,"tag":381,"props":1327,"children":1328},{"style":410},[1329],{"type":329,"value":567},{"type":320,"tag":381,"props":1331,"children":1332},{"style":394},[1333],{"type":329,"value":572},{"type":320,"tag":381,"props":1335,"children":1336},{"style":410},[1337],{"type":329,"value":361},{"type":320,"tag":381,"props":1339,"children":1340},{"style":415},[1341],{"type":329,"value":581},{"type":320,"tag":381,"props":1343,"children":1344},{"style":410},[1345],{"type":329,"value":1153},{"type":320,"tag":381,"props":1347,"children":1348},{"class":383,"line":458},[1349,1354,1359,1363,1367,1371,1376,1380,1384,1388,1392,1396,1401,1405,1409,1413,1417,1421,1425,1429,1434],{"type":320,"tag":381,"props":1350,"children":1351},{"style":410},[1352],{"type":329,"value":1353},"  text: ",{"type":320,"tag":381,"props":1355,"children":1356},{"style":606},[1357],{"type":329,"value":1358},"`New ${",{"type":320,"tag":381,"props":1360,"children":1361},{"style":410},[1362],{"type":329,"value":801},{"type":320,"tag":381,"props":1364,"children":1365},{"style":606},[1366],{"type":329,"value":361},{"type":320,"tag":381,"props":1368,"children":1369},{"style":410},[1370],{"type":329,"value":801},{"type":320,"tag":381,"props":1372,"children":1373},{"style":606},[1374],{"type":329,"value":1375},"}: order ${",{"type":320,"tag":381,"props":1377,"children":1378},{"style":410},[1379],{"type":329,"value":801},{"type":320,"tag":381,"props":1381,"children":1382},{"style":606},[1383],{"type":329,"value":361},{"type":320,"tag":381,"props":1385,"children":1386},{"style":410},[1387],{"type":329,"value":826},{"type":320,"tag":381,"props":1389,"children":1390},{"style":606},[1391],{"type":329,"value":361},{"type":320,"tag":381,"props":1393,"children":1394},{"style":410},[1395],{"type":329,"value":835},{"type":320,"tag":381,"props":1397,"children":1398},{"style":606},[1399],{"type":329,"value":1400},"} for ${",{"type":320,"tag":381,"props":1402,"children":1403},{"style":410},[1404],{"type":329,"value":801},{"type":320,"tag":381,"props":1406,"children":1407},{"style":606},[1408],{"type":329,"value":361},{"type":320,"tag":381,"props":1410,"children":1411},{"style":410},[1412],{"type":329,"value":826},{"type":320,"tag":381,"props":1414,"children":1415},{"style":606},[1416],{"type":329,"value":361},{"type":320,"tag":381,"props":1418,"children":1419},{"style":410},[1420],{"type":329,"value":868},{"type":320,"tag":381,"props":1422,"children":1423},{"style":388},[1424],{"type":329,"value":873},{"type":320,"tag":381,"props":1426,"children":1427},{"style":394},[1428],{"type":329,"value":492},{"type":320,"tag":381,"props":1430,"children":1431},{"style":606},[1432],{"type":329,"value":1433},"}`",{"type":320,"tag":381,"props":1435,"children":1436},{"style":410},[1437],{"type":329,"value":497},{"type":320,"tag":381,"props":1439,"children":1440},{"class":383,"line":467},[1441],{"type":320,"tag":381,"props":1442,"children":1443},{"style":410},[1444],{"type":329,"value":1214},{"type":320,"tag":381,"props":1446,"children":1447},{"class":383,"line":476},[1448,1452,1456,1460,1464,1468,1472],{"type":320,"tag":381,"props":1449,"children":1450},{"style":410},[1451],{"type":329,"value":557},{"type":320,"tag":381,"props":1453,"children":1454},{"style":415},[1455],{"type":329,"value":599},{"type":320,"tag":381,"props":1457,"children":1458},{"style":410},[1459],{"type":329,"value":567},{"type":320,"tag":381,"props":1461,"children":1462},{"style":606},[1463],{"type":329,"value":609},{"type":320,"tag":381,"props":1465,"children":1466},{"style":410},[1467],{"type":329,"value":614},{"type":320,"tag":381,"props":1469,"children":1470},{"style":606},[1471],{"type":329,"value":619},{"type":320,"tag":381,"props":1473,"children":1474},{"style":410},[1475],{"type":329,"value":624},{"type":320,"tag":381,"props":1477,"children":1478},{"class":383,"line":500},[1479,1483,1488,1492,1497],{"type":320,"tag":381,"props":1480,"children":1481},{"style":410},[1482],{"type":329,"value":557},{"type":320,"tag":381,"props":1484,"children":1485},{"style":415},[1486],{"type":329,"value":1487},"setMethod",{"type":320,"tag":381,"props":1489,"children":1490},{"style":410},[1491],{"type":329,"value":567},{"type":320,"tag":381,"props":1493,"children":1494},{"style":606},[1495],{"type":329,"value":1496},"\"POST\"",{"type":320,"tag":381,"props":1498,"children":1499},{"style":410},[1500],{"type":329,"value":624},{"type":320,"tag":321,"props":1502,"children":1503},{},[1504,1506,1512,1513,1519,1520,1526,1528,1534],{"type":329,"value":1505},"Worked examples: ",{"type":320,"tag":1252,"props":1507,"children":1509},{"href":1508},"/blog/stripe-webhook-to-slack",[1510],{"type":329,"value":1511},"Stripe webhooks to Slack",{"type":329,"value":614},{"type":320,"tag":1252,"props":1514,"children":1516},{"href":1515},"/blog/webhook-to-discord",[1517],{"type":329,"value":1518},"webhook to Discord",{"type":329,"value":614},{"type":320,"tag":1252,"props":1521,"children":1523},{"href":1522},"/blog/webhook-to-microsoft-teams",[1524],{"type":329,"value":1525},"webhook to Microsoft Teams",{"type":329,"value":1527},". The free ",{"type":320,"tag":1252,"props":1529,"children":1531},{"href":1530},"/webhook-message-formatter",[1532],{"type":329,"value":1533},"message formatter",{"type":329,"value":1535}," generates this function from a sample payload.",{"type":320,"tag":334,"props":1537,"children":1539},{"id":1538},"convert-form-data-to-json",[1540],{"type":329,"value":1541},"Convert form data to JSON",{"type":320,"tag":321,"props":1543,"children":1544},{},[1545,1547,1553,1555,1560,1562,1567,1569,1575],{"type":329,"value":1546},"HTML forms and some providers send ",{"type":320,"tag":346,"props":1548,"children":1550},{"className":1549},[],[1551],{"type":329,"value":1552},"application/x-www-form-urlencoded",{"type":329,"value":1554}," or multipart bodies. Parse them and emit JSON; see ",{"type":320,"tag":1252,"props":1556,"children":1557},{"href":221},[1558],{"type":329,"value":1559},"URL-encoded data",{"type":329,"value":1561}," and ",{"type":320,"tag":1252,"props":1563,"children":1564},{"href":218},[1565],{"type":329,"value":1566},"multipart form data",{"type":329,"value":1568},". A worked example: ",{"type":320,"tag":1252,"props":1570,"children":1572},{"href":1571},"/blog/jotform-webhook-form-data-json",[1573],{"type":329,"value":1574},"Jotform to JSON",{"type":329,"value":361},{"type":320,"tag":334,"props":1577,"children":1579},{"id":1578},"wrap-or-unwrap-an-envelope",[1580],{"type":329,"value":1581},"Wrap or unwrap an envelope",{"type":320,"tag":321,"props":1583,"children":1584},{},[1585],{"type":329,"value":1586},"Some destinations want the original event inside a wrapper, others want it unwrapped:",{"type":320,"tag":371,"props":1588,"children":1590},{"className":373,"code":1589,"language":375,"meta":294,"style":294},"const event = JSON.parse(r.body)\n\n// wrap: destination expects { source, payload }\nr.setBody(JSON.stringify({ source: \"stripe\", payload: event }))\n\n// unwrap: forward only the inner object\n// r.setBody(JSON.stringify(event.data.object))\n",[1591],{"type":320,"tag":346,"props":1592,"children":1593},{"__ignoreMap":294},[1594,1625,1632,1641,1683,1690,1698],{"type":320,"tag":381,"props":1595,"children":1596},{"class":383,"line":384},[1597,1601,1605,1609,1613,1617,1621],{"type":320,"tag":381,"props":1598,"children":1599},{"style":388},[1600],{"type":329,"value":391},{"type":320,"tag":381,"props":1602,"children":1603},{"style":394},[1604],{"type":329,"value":1094},{"type":320,"tag":381,"props":1606,"children":1607},{"style":388},[1608],{"type":329,"value":402},{"type":320,"tag":381,"props":1610,"children":1611},{"style":394},[1612],{"type":329,"value":407},{"type":320,"tag":381,"props":1614,"children":1615},{"style":410},[1616],{"type":329,"value":361},{"type":320,"tag":381,"props":1618,"children":1619},{"style":415},[1620],{"type":329,"value":418},{"type":320,"tag":381,"props":1622,"children":1623},{"style":410},[1624],{"type":329,"value":423},{"type":320,"tag":381,"props":1626,"children":1627},{"class":383,"line":426},[1628],{"type":320,"tag":381,"props":1629,"children":1630},{"emptyLinePlaceholder":430},[1631],{"type":329,"value":433},{"type":320,"tag":381,"props":1633,"children":1634},{"class":383,"line":436},[1635],{"type":320,"tag":381,"props":1636,"children":1638},{"style":1637},"--shiki-default:#6A737D",[1639],{"type":329,"value":1640},"// wrap: destination expects { source, payload }\n",{"type":320,"tag":381,"props":1642,"children":1643},{"class":383,"line":458},[1644,1648,1652,1656,1660,1664,1668,1673,1678],{"type":320,"tag":381,"props":1645,"children":1646},{"style":410},[1647],{"type":329,"value":557},{"type":320,"tag":381,"props":1649,"children":1650},{"style":415},[1651],{"type":329,"value":562},{"type":320,"tag":381,"props":1653,"children":1654},{"style":410},[1655],{"type":329,"value":567},{"type":320,"tag":381,"props":1657,"children":1658},{"style":394},[1659],{"type":329,"value":572},{"type":320,"tag":381,"props":1661,"children":1662},{"style":410},[1663],{"type":329,"value":361},{"type":320,"tag":381,"props":1665,"children":1666},{"style":415},[1667],{"type":329,"value":581},{"type":320,"tag":381,"props":1669,"children":1670},{"style":410},[1671],{"type":329,"value":1672},"({ source: ",{"type":320,"tag":381,"props":1674,"children":1675},{"style":606},[1676],{"type":329,"value":1677},"\"stripe\"",{"type":320,"tag":381,"props":1679,"children":1680},{"style":410},[1681],{"type":329,"value":1682},", payload: event }))\n",{"type":320,"tag":381,"props":1684,"children":1685},{"class":383,"line":467},[1686],{"type":320,"tag":381,"props":1687,"children":1688},{"emptyLinePlaceholder":430},[1689],{"type":329,"value":433},{"type":320,"tag":381,"props":1691,"children":1692},{"class":383,"line":476},[1693],{"type":320,"tag":381,"props":1694,"children":1695},{"style":1637},[1696],{"type":329,"value":1697},"// unwrap: forward only the inner object\n",{"type":320,"tag":381,"props":1699,"children":1700},{"class":383,"line":500},[1701],{"type":320,"tag":381,"props":1702,"children":1703},{"style":1637},[1704],{"type":329,"value":1705},"// r.setBody(JSON.stringify(event.data.object))\n",{"type":320,"tag":334,"props":1707,"children":1709},{"id":1708},"test-the-transformation",[1710],{"type":329,"value":1711},"Test the transformation",{"type":320,"tag":1713,"props":1714,"children":1715},"ol",{},[1716,1730,1735],{"type":320,"tag":1717,"props":1718,"children":1719},"li",{},[1720,1722,1728],{"type":329,"value":1721},"Capture a real payload with the free ",{"type":320,"tag":1252,"props":1723,"children":1725},{"href":1724},"/webhook-bin",[1726],{"type":329,"value":1727},"Webhook Bin",{"type":329,"value":1729}," or read one from the bucket's logs.",{"type":320,"tag":1717,"props":1731,"children":1732},{},[1733],{"type":329,"value":1734},"Paste it into the function editor's test panel and run the function; the editor shows the resulting request.",{"type":320,"tag":1717,"props":1736,"children":1737},{},[1738],{"type":329,"value":1739},"Send a test event from the provider and check the delivery log for the destination's response.",{"type":320,"tag":321,"props":1741,"children":1742},{},[1743,1745,1750,1751,1756,1757,1762,1764,1770],{"type":329,"value":1744},"Next: ",{"type":320,"tag":1252,"props":1746,"children":1747},{"href":215},[1748],{"type":329,"value":1749},"modify headers, method and path",{"type":329,"value":614},{"type":320,"tag":1252,"props":1752,"children":1753},{"href":253},[1754],{"type":329,"value":1755},"filter or drop webhooks",{"type":329,"value":614},{"type":320,"tag":1252,"props":1758,"children":1759},{"href":212},[1760],{"type":329,"value":1761},"call an external API to enrich the payload",{"type":329,"value":1763},". More copy-paste patterns in the ",{"type":320,"tag":1252,"props":1765,"children":1767},{"href":1766},"/blog/auto-transform-webhook",[1768],{"type":329,"value":1769},"transformation cookbook",{"type":329,"value":361},{"type":320,"tag":1772,"props":1773,"children":1774},"style",{},[1775],{"type":329,"value":1776},"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":294,"searchDepth":436,"depth":436,"links":1778},[1779,1780,1781,1782,1783,1784],{"id":336,"depth":426,"text":339},{"id":1026,"depth":426,"text":1029},{"id":1261,"depth":426,"text":1264},{"id":1538,"depth":426,"text":1541},{"id":1578,"depth":426,"text":1581},{"id":1708,"depth":426,"text":1711},"markdown","content:docs:webhooks:functions:16.transform-webhook-payload.md","content","docs/webhooks/functions/16.transform-webhook-payload.md","docs/webhooks/functions/16.transform-webhook-payload","md",{"loc":250},1788848783609]