VelaIngestClient sends events into your Vela app. It authenticates with your app’s API key (vela_live_...), which is scoped to a single app and can only ingest events — it cannot read or modify any data.
Constructor
| Option | Type | Default | Description |
|---|---|---|---|
baseUrl | string | https://api.velahq.xyz | API base URL. Override for self-hosted instances. |
timeout | number | 30000 | Request timeout in milliseconds. |
fetchImpl | typeof fetch | globalThis.fetch | Custom fetch implementation (for Node 16 or testing). |
Send a single event
Event fields reference
| Field | Required | Type | Description |
|---|---|---|---|
event | yes | string | Event name. Must match a registered schema’s eventName. Events without a matching schema are rejected with 400. |
data | yes | object | Payload object. Validated against the schema’s field definitions. |
level | yes | string | Severity level — see table below. |
customer_id | no | string | Identifier for the customer this event is associated with. Enables per-customer filtering in the dashboard. |
metadata | no | object | Contextual data (environment, trace ID, etc.). Validated against schema metadataFields if defined. |
timestamp | no | string | ISO-8601 timestamp for when the event occurred. Defaults to server ingest time if omitted. |
Event levels
| Level | When to use | Examples |
|---|---|---|
info | Normal business events | order.placed, user.signed_up, session.started |
success | Completed flows | payment.captured, email.delivered, export.completed |
warning | Degraded but non-critical | retry.attempt, rate_limit_approaching, cache.miss |
error | Failures requiring attention | payment.failed, webhook.error, job.failed |
Send a batch
Send up to 100 events in a single request. This is more efficient than sending events one by one when you have multiple events to ingest at the same time.Response shape
Both single and batch ingestion return the same response type:Error handling
If validation fails, Vela returns a400 error which the SDK throws as VelaValidationError: