Modules
module-http
The HTTP module is a queueing transport with bounded batches, retries, and explicit flushing.
npm install @eventvisor/sdk @eventvisor/module-httpimport { createEventvisor } from "@eventvisor/sdk";import { createHttpModule } from "@eventvisor/module-http";const eventvisor = createEventvisor({ datafile, modules: [ createHttpModule({ url: "https://events.example.com/collect", batchSize: 20, flushIntervalMs: 1000, maxRetries: 2, }), ],});Use transport: http in a destination. track() queues the selected event. The module flushes full batches and timed batches, retries failed requests with backoff, and reports terminal failures through diagnostics. Call await eventvisor.flush() before a controlled shutdown.
The queue is memory-only and bounded by maxQueueSize. Configure durable server-side ingestion if delivery must survive a process or browser crash.
Options#
url: required string, or a function receiving transport metadata.name: module and transport name. Defaults tohttp.headers: request headers merged with JSON content type.batchSize: events per request. Defaults to20.flushIntervalMs: timed flush interval. Defaults to1000. Use0to disable it.maxQueueSize: bounded queue size. Defaults to1000.maxRetries: retries after the first attempt. Defaults to2.retryDelayMs: initial exponential backoff delay. Defaults to250.fetch: custom Fetch implementation.buildBody: function that receives a batch and returns the request body value.
Batches are grouped by resolved URL. One failed URL does not block another URL in the same flush.

