[{"data":1,"prerenderedAt":329},["ShallowReactive",2],{"term-w\u002Fwebhook":3,"related-w\u002Fwebhook":311},{"id":4,"title":5,"acronym":6,"body":7,"category":292,"description":293,"difficulty":294,"extension":295,"letter":296,"meta":297,"navigation":298,"path":299,"related":300,"seo":305,"sitemap":306,"stem":309,"subcategory":6,"__hash__":310},"terms\u002Fterms\u002Fw\u002Fwebhook.md","Webhook",null,{"type":8,"value":9,"toc":286},"minimark",[10,15,19,23,26,30,275,279,282],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"A way for one app to automatically notify another when something happens. Instead of constantly asking 'did anything change?' (polling), the app just TELLS you when something happens. Like getting a text notification instead of refreshing your inbox every 5 seconds. Stripe sends webhooks when payments succeed, GitHub sends them when code is pushed.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"A webhook is an HTTP callback that delivers real-time notifications from one system to another when an event occurs. The source system sends an HTTP POST request to a pre-configured URL with event data. Webhooks are the foundation of event-driven integrations and are more efficient than polling.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Express webhook endpoint for Stripe\napp.post('\u002Fwebhook\u002Fstripe', (req, res) => {\n  const event = req.body\n  switch (event.type) {\n    case 'payment_intent.succeeded':\n      handlePaymentSuccess(event.data.object)\n      break\n    case 'customer.subscription.deleted':\n      handleCancellation(event.data.object)\n      break\n  }\n  res.json({ received: true })\n})\n","javascript","",[38,39,40,49,101,121,145,162,185,191,205,225,230,236,267],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"sHwdD","\u002F\u002F Express webhook endpoint for Stripe\n",[41,50,52,56,60,64,67,70,74,76,79,82,86,88,91,94,98],{"class":43,"line":51},2,[41,53,55],{"class":54},"sTEyZ","app",[41,57,59],{"class":58},"sMK4o",".",[41,61,63],{"class":62},"s2Zo4","post",[41,65,66],{"class":54},"(",[41,68,69],{"class":58},"'",[41,71,73],{"class":72},"sfazB","\u002Fwebhook\u002Fstripe",[41,75,69],{"class":58},[41,77,78],{"class":58},",",[41,80,81],{"class":58}," (",[41,83,85],{"class":84},"sHdIc","req",[41,87,78],{"class":58},[41,89,90],{"class":84}," res",[41,92,93],{"class":58},")",[41,95,97],{"class":96},"spNyl"," =>",[41,99,100],{"class":58}," {\n",[41,102,104,107,110,113,116,118],{"class":43,"line":103},3,[41,105,106],{"class":96},"  const",[41,108,109],{"class":54}," event",[41,111,112],{"class":58}," =",[41,114,115],{"class":54}," req",[41,117,59],{"class":58},[41,119,120],{"class":54},"body\n",[41,122,124,128,131,134,136,139,142],{"class":43,"line":123},4,[41,125,127],{"class":126},"s7zQu","  switch",[41,129,81],{"class":130},"swJcz",[41,132,133],{"class":54},"event",[41,135,59],{"class":58},[41,137,138],{"class":54},"type",[41,140,141],{"class":130},") ",[41,143,144],{"class":58},"{\n",[41,146,148,151,154,157,159],{"class":43,"line":147},5,[41,149,150],{"class":126},"    case",[41,152,153],{"class":58}," '",[41,155,156],{"class":72},"payment_intent.succeeded",[41,158,69],{"class":58},[41,160,161],{"class":58},":\n",[41,163,165,168,170,172,174,177,179,182],{"class":43,"line":164},6,[41,166,167],{"class":62},"      handlePaymentSuccess",[41,169,66],{"class":130},[41,171,133],{"class":54},[41,173,59],{"class":58},[41,175,176],{"class":54},"data",[41,178,59],{"class":58},[41,180,181],{"class":54},"object",[41,183,184],{"class":130},")\n",[41,186,188],{"class":43,"line":187},7,[41,189,190],{"class":126},"      break\n",[41,192,194,196,198,201,203],{"class":43,"line":193},8,[41,195,150],{"class":126},[41,197,153],{"class":58},[41,199,200],{"class":72},"customer.subscription.deleted",[41,202,69],{"class":58},[41,204,161],{"class":58},[41,206,208,211,213,215,217,219,221,223],{"class":43,"line":207},9,[41,209,210],{"class":62},"      handleCancellation",[41,212,66],{"class":130},[41,214,133],{"class":54},[41,216,59],{"class":58},[41,218,176],{"class":54},[41,220,59],{"class":58},[41,222,181],{"class":54},[41,224,184],{"class":130},[41,226,228],{"class":43,"line":227},10,[41,229,190],{"class":126},[41,231,233],{"class":43,"line":232},11,[41,234,235],{"class":58},"  }\n",[41,237,239,242,244,247,249,252,255,258,262,265],{"class":43,"line":238},12,[41,240,241],{"class":54},"  res",[41,243,59],{"class":58},[41,245,246],{"class":62},"json",[41,248,66],{"class":130},[41,250,251],{"class":58},"{",[41,253,254],{"class":130}," received",[41,256,257],{"class":58},":",[41,259,261],{"class":260},"sfNiH"," true",[41,263,264],{"class":58}," }",[41,266,184],{"class":130},[41,268,270,273],{"class":43,"line":269},13,[41,271,272],{"class":58},"}",[41,274,184],{"class":54},[11,276,278],{"id":277},"when-youll-hear-this","When You'll Hear This",[16,280,281],{},"\"Set up a webhook so we get notified when a payment succeeds.\" \u002F \"The webhook is failing — check if the endpoint is returning 200.\"",[283,284,285],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":51,"depth":51,"links":287},[288,289,290,291],{"id":13,"depth":51,"text":14},{"id":21,"depth":51,"text":22},{"id":28,"depth":51,"text":29},{"id":277,"depth":51,"text":278},"backend","A way for one app to automatically notify another when something happens. Instead of constantly asking 'did anything change?","beginner","md","w",{},true,"\u002Fterms\u002Fw\u002Fwebhook",[301,302,303,304],"API","Event-driven","Pub\u002FSub","HTTP",{"title":5,"description":293},{"changefreq":307,"priority":308},"weekly",0.7,"terms\u002Fw\u002Fwebhook","HiN6arQljT7razDnexeyVK1HNDGvRmw9GJD-Vy6ESug",[312,316,320,325],{"title":301,"path":313,"acronym":314,"category":292,"difficulty":294,"description":315},"\u002Fterms\u002Fa\u002Fapi","Application Programming Interface","An API is like a menu at a restaurant. The kitchen (server) can do a bunch of things, but you can only order what's on the menu.",{"title":302,"path":317,"acronym":6,"category":292,"difficulty":318,"description":319},"\u002Fterms\u002Fe\u002Fevent-driven","intermediate","Event-driven architecture means services react to things that happen instead of constantly asking 'did anything change?",{"title":304,"path":321,"acronym":322,"category":323,"difficulty":294,"description":324},"\u002Fterms\u002Fh\u002Fhttp","HyperText Transfer Protocol","networking","HTTP is the language your browser uses to ask websites for stuff. You type a URL, your browser shouts 'hey, give me that page!",{"title":303,"path":326,"acronym":303,"category":327,"difficulty":318,"description":328},"\u002Fterms\u002Fp\u002Fpub-sub","architecture","Pub\u002FSub is like a newspaper service. Publishers write articles and drop them off.",1776518258194]