Skip to main content

Web API Destination

Web Source code Package

The web API destination allows you to send events from the browser to any HTTP endpoint with customizable data transformation and transport methods.

Where this fits

Web API is a web destination in the walkerOS flow:

Sends events from the browser to any HTTP endpoint using fetch, XHR, or beacon transport with customizable request formatting.

Installation

Loading...

Configuration

This destination uses the standard destination config wrapper (consent, data, env, id, ...). For the shared fields see destination configuration. Package-specific fields live under config.settings and are listed below.

Settings

PropertyTypeDescriptionMore
url*stringThe HTTP endpoint URL to send events to
headersRecord<string, string>Additional HTTP headers to include with requests
method*stringHTTP method for the request
transformfunctionFunction to transform event data before sending
transport*'fetch' | 'xhr' | 'beacon'Transport method for sending requests
* Required fields

Mapping

This package does not define custom rule-level settings. For the standard rule fields (consent, condition, data, batch, name, policy) see mapping.

Examples

Custom payload

An order event is reshaped via a data mapping into a custom JSON body for the API endpoint.

Event
Mapping
Out

Entity action

A generic entity action event is forwarded to the configured API endpoint with the mapped data JSON body.

Event
Mapping
Out

Page view

A page view is POSTed to the configured API endpoint with the event data section as the JSON body.

Event
Mapping
Out

Modes

Loading...

Usage

Basic usage

Loading...

Advanced usage with transform

Loading...

Use cases

Sending to analytics API

Loading...

Using beacon transport

For critical events that need to be sent even when the page is unloading:

Loading...

Custom data mapping

Use mapping rules to control which events are sent:

Loading...

Transport methods

  • fetch (default): Modern, promise-based HTTP requests
  • xhr: Traditional XMLHttpRequest for older browser compatibility
  • beacon: Uses Navigator.sendBeacon() for reliable data transmission during page unload
💡 Need implementation support?
elbwalker offers hands-on support: setup review, measurement planning, destination mapping, and live troubleshooting. Book a 2-hour session (€399)