Skip to main content
WendungServer sends funnel steps from server code with a secret key. Each call sends one step and waits for ingest to accept it. There is no queue or flush timer, so it works in serverless functions that stop after the response.
It uses only fetch, so it runs on Node.js 18 or newer, Cloudflare Workers, Vercel Edge Functions, and Deno.

Constructor

string
required
The project’s secret key. It must start with sk_; the constructor throws otherwise. Read it from the server environment, never from frontend code.
string
default:"https://ingest.wendung.app/v1/events"
The ingest URL.
boolean
default:"false"
Logs accepted steps with console.log. Failures always log with console.warn.

step()

string
required
The step name, 1 to 100 characters. Names that start with $ are reserved.
string
required
A unique ID for this step, up to 100 characters. Use the source event’s own ID, such as a Stripe event ID, so a retried webhook is stored once.
string
required
The user the step belongs to, up to 255 characters. Use the same ID you pass to identify() in the browser.
Date | string
required
When the step happened, as a Date or an ISO 8601 string. Ingest accepts steps up to 7 days old and at most 5 minutes in the future.
Record<string, unknown>
Optional metadata for this step, up to 20 top-level keys.

Returns

Promise<ServerStepResult>. It never rejects. step() retries 429 responses, 5xx responses, and network failures up to three attempts, waiting 0.5 and then 1 second between them. Other 4xx responses are returned without a retry. See Errors for the rejection reasons.

Example