Server API Destination
The server API destination sends events from Node.js to any HTTP(S) endpoint using native HTTP/HTTPS modules. It auto-selects HTTP or HTTPS from the URL, supports configurable timeouts (default 5000ms), custom transforms, and dependency injection for testing.
Server API is a server destination in the walkerOS flow:
Sends events server-side to any HTTP endpoint using Node.js native modules with configurable request formatting and batching.
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 API endpoint URL to send events to | |
headers | Record<string, string> | Custom HTTP headers to include with requests | |
method | string | HTTP method to use (default: POST) | |
timeout | number | Request timeout in milliseconds (default: 5000) |
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 headers
A form submission is sent to the API with custom request headers such as an API key for authentication.
Custom payload
An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.
Forward event data
A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.
Usage
Basic usage
With headers and timeout
With custom transform
Use cases
Webhook integration
Custom analytics backend
With event mapping
Related
- Web API Destination - Browser-side variant
- Mapping - Transform events before sending