Web API Destination
The web API destination allows you to send events from the browser to any HTTP endpoint with customizable data transformation and transport methods.
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
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
| Property | Type | Description | More |
|---|---|---|---|
url | string | The HTTP endpoint URL to send events to | |
headers | Record<string, string> | Additional HTTP headers to include with requests | |
method | string | HTTP method for the request | |
transform | function | Function to transform event data before sending | |
transport | 'fetch' | 'xhr' | 'beacon' | Transport method for sending requests |
Mapping
Per-event rules under config.mapping. For the standard rule fields (consent, condition, data, batch, name, policy) see mapping.
| Property | Type | Description | More |
|---|
Examples
custom transform
entity action
page view
Modes
- Integrated
- Bundled
Usage
Basic usage
Advanced usage with transform
Use cases
Sending to analytics API
Using beacon transport
For critical events that need to be sent even when the page is unloading:
Custom data mapping
Use mapping rules to control which events are sent:
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