<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Webhooks on BenzHub</title><link>https://benzhub.github.io/tags/webhooks/</link><description>Recent content in Webhooks on BenzHub</description><generator>Hugo</generator><language>zh-TW</language><lastBuildDate>Fri, 23 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://benzhub.github.io/tags/webhooks/index.xml" rel="self" type="application/rss+xml"/><item><title>Edge Functions 串流回應與 Webhooks 實戰 | Supabase 完整教學</title><link>https://benzhub.github.io/post/supabase/034-edge-functions-streaming-webhooks/</link><pubDate>Fri, 23 Oct 2026 00:00:00 +0000</pubDate><guid>https://benzhub.github.io/post/supabase/034-edge-functions-streaming-webhooks/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;上一篇《Background Tasks 與 Cron》我們讓 &lt;strong&gt;Edge Function&lt;/strong&gt; 學會了在回應後繼續幹活、也能定時自己醒來。這一篇補上運算篇章最後兩塊拼圖：&lt;strong&gt;串流回應&lt;/strong&gt;與 &lt;strong&gt;Webhooks&lt;/strong&gt;。前者讓伺服器「一段一段」把內容推給客戶端——用 &lt;strong&gt;&lt;code&gt;ReadableStream&lt;/code&gt;&lt;/strong&gt; 搭配 &lt;strong&gt;&lt;code&gt;text/event-stream&lt;/code&gt;&lt;/strong&gt;（&lt;strong&gt;Server-Sent Events&lt;/strong&gt;）做出 ChatGPT 那種逐字浮現的體驗，把 LLM 的串流輸出直接轉發給前端；後者讓你的函式能被「事件」驅動——用 &lt;strong&gt;Database Webhooks&lt;/strong&gt;（底層是 &lt;strong&gt;&lt;code&gt;pg_net&lt;/code&gt;&lt;/strong&gt;）在資料一變動就觸發函式，並安全地接住 &lt;strong&gt;Stripe&lt;/strong&gt; 這類第三方 webhook：讀原始 body、用 &lt;strong&gt;HMAC&lt;/strong&gt; 驗簽、以 &lt;strong&gt;constant-time compare&lt;/strong&gt; 比對。這一篇收尾 Edge Functions 段。&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item></channel></rss>