HTTP (Generic)
Install
Section titled “Install”npm install @junctionjs/destination-httppnpm add @junctionjs/destination-httpyarn add @junctionjs/destination-httpimport { 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", }, }), }, ],});Features
Section titled “Features”- 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.stringifyfor any format - Webhooks — ideal for Slack, Discord, or any webhook-based integration
- Error handling —
onErrorcallback for non-2xx responses