Blogs Home

Introducing Event Sink: Stream Blotout Events to Any Endpoint

March 18, 2025

We recently introduced a new provider channel called Event Sink. Its purpose: to give Blotout users a universal way to forward events to any HTTP endpoint that accepts JSON payloads via POST.

If you’ve ever wanted to process raw events directly—without intermediaries—you now can. Simply provide your own HTTP server, and Event Sink will stream events in real time.

Why We Built Event Sink

Customers told us they wanted more flexibility:

  • Direct access to event data
  • Ability to build custom workflows on top of Blotout
  • Integration into existing data pipelines

Event Sink delivers exactly that—raw events, your way.

How Event Sink Works

Events are first collected through a Cloudflare Worker, which handles traffic from browsers and other sources. From there, the Worker forwards them to the endpoint you configure in your tag settings.

When you set up an Event Sink channel, you’ll provide:

  • The HTTP endpoint URL
  • Any custom request headers

Once saved, every event generated on your tag is forwarded in real time.

Understanding the Event Payload

Each POST request contains a JSON object with three properties:

type JSONRequestBody = {
  action: 'tag' | 'user'
  payload: { /* event-specific data */ }
  user: { /* user information */ }
}

  • action: 'tag' → events generated by the tag
  • action: 'user' → data collected directly from the user

Requests include Content-Type: application/json; charset=utf-8 plus any custom headers you configure.

Example Implementation with Cloudflare Workers

To demonstrate, let’s create a Cloudflare Worker to receive and log incoming events.

Step 1: Create a Worker

  • Log into Cloudflare
  • Create a new Worker from the Hello World template
  • Deploy it with a unique name


Step 2: Implement a POST Handler

Replace the Worker code with:

export default {
  async fetch(request, env, ctx) {
    if (request.method == 'POST') {
      const requestPayload = await request.json()
      const headers = [...request.headers.entries()]
      console.log(requestPayload, { headers })
      return new Response(JSON.stringify({ success: true }), {
        headers: new Headers({
          'Content-Type': 'application/json; charset=utf-8',
        }),
      })
    }
    return new Response('Not found', { status: 404 })
  },
}

Step 3: Verify Your Setup

  • Send a test POST request with a JSON payload
  • Open Realtime Logs in Cloudflare to view the events
  • Add your Worker endpoint URL to the Event Sink provider form in EdgeTag

Now, every event your tag generates will appear in Worker logs.

Scaling Considerations

Before deploying, estimate expected event volume:

  • In Tag Analytics, switch the chart to Minute resolution
  • View the last 24 hours to estimate peak throughput

Because Workers auto-scale with traffic, they handle spikes without extra infrastructure.

Securing Your Endpoint

To prevent unauthorized POSTs, configure a secret header in the Event Sink provider form. Your Worker can then validate this header and reject invalid requests.

This ensures only Blotout can stream events to your endpoint.

FAQs: Event Sink

Q1: What’s the difference between Event Sink and Event Sink + Firehose?
Event Sink is the base channel. You can extend it with AWS Firehose (or other pipelines) for data lakes.

Q2: Can I forward events to multiple endpoints?
Yes, by deploying multiple Workers or chaining logic in your Worker.

Q3: Do I need my own servers?
No. Cloudflare Workers provide serverless auto-scaling—perfect for this use case.

Conclusion: Build on Your Event Stream

With Event Sink, you can now stream Blotout events directly into your own infrastructure—no middleware required.

Whether you’re logging raw data, enriching it, or forwarding to a data lake, Event Sink puts you in control of your event pipeline.

👉 Have you built something interesting on top of Event Sink? We’d love to hear your story!