Skip to content

HTTP (Generic)

Terminal window
npm install @junctionjs/destination-http
import { createCollector } from "@junctionjs/core";
import { http } from "@junctionjs/destination-http";
const collector = createCollector({
destinations: [
{
destination: http({
url: "https://your-api.example.com/events",
headers: {
Authorization: "Bearer YOUR_TOKEN",
},
}),
},
],
});
  • Any HTTP endpoint — POST events to webhooks, custom APIs, or third-party services
  • Configurable headers — static headers or dynamic per-event headers via headersFn
  • Configurable method — POST, PUT, or PATCH
  • Custom body transform — reshape event payloads before sending
  • Custom serializer — swap out JSON.stringify for any format
  • Webhooks — ideal for Slack, Discord, or any webhook-based integration
  • Error handlingonError callback for non-2xx responses