Eventvisor

Modules

module-http

The HTTP module is a queueing transport with bounded batches, retries, and explicit flushing.

npm install @eventvisor/sdk @eventvisor/module-http
import { 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 to http.
  • headers: request headers merged with JSON content type.
  • batchSize: events per request. Defaults to 20.
  • flushIntervalMs: timed flush interval. Defaults to 1000. Use 0 to disable it.
  • maxQueueSize: bounded queue size. Defaults to 1000.
  • maxRetries: retries after the first attempt. Defaults to 2.
  • retryDelayMs: initial exponential backoff delay. Defaults to 250.
  • 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.

Previous
module-console