SDK Reference
The complete method surface of the @vanta-dev/node SDK.
This page lists every public method on the Node SDK client, grouped by category. All examples below use the client constructed once with your API key.
import { Vanta } from '@vanta-dev/node'
const vanta = new Vanta({
apiKey: process.env.VANTA_API_KEY
})
Event tracking
| Method | Description |
|---|
vanta.track({ event, userId?, groupId?, source?, data?, context?, tags? }) | Tracks an event with optional user, group, data, context, and tags. |
vanta.error(err | string) | Records an error event from an Error instance or message string. |
vanta.getEvent(id) | Fetches a single event by id. |
vanta.queryEvents(...) | Queries events with filters, sorting, and pagination. |
Identification
| Method | Description |
|---|
vanta.identify({ userId, email?, name?, avatar?, properties? }) | Identifies a user and links future events to them. |
vanta.group({ groupId, type?, name?, properties? }) | Associates events with a group such as a team or organization. |
Metrics
| Method | Description |
|---|
vanta.measure({ name, value, unit?, tags? }) | Records a numeric measurement. Default aggregation is avg. |
vanta.increment(name, value?) | Increments a counter. Default value is 1. |
vanta.decrement(name, value?) | Decrements a counter. Default value is 1. |
vanta.metrics.submit(...) | Submits a metric. |
vanta.metrics.query(...) | Queries metric values over a range. |
vanta.metrics.timeseries(...) | Returns a metric as a time series. |
vanta.metrics.current(...) | Returns the current value of a metric. |
vanta.metrics.list() | Lists available metrics. |
Analytics
| Method | Description |
|---|
vanta.count(...) | Counts events matching the query. |
vanta.groupBy(...) | Groups events by one or more fields. |
vanta.timeseries(...) | Returns event counts bucketed over time. |
vanta.aggregate(...) | Applies aggregations such as sum, avg, and max. |
vanta.unique(...) | Returns distinct values for a field. |
Uptime
| Method | Description |
|---|
vanta.uptime.heartbeat(...) | Sends a heartbeat for a monitor. |
vanta.uptime.getMonitor(id) | Fetches a monitor by id. |
vanta.uptime.listMonitors() | Lists monitors. |
vanta.uptime.getHeartbeats(id) | Fetches heartbeat history. |
vanta.uptime.getIncidents(id) | Fetches incidents for a monitor. |
vanta.uptime.getStats(id, period) | Returns uptime statistics. |
vanta.uptime.start(name, ...) | Starts sending periodic heartbeats. Returns a handle with a stop() method. |
Utilities and errors
| Item | Description |
|---|
filter(field, operator, value) | Builds a single filter condition. |
and(...filters) | Combines filters with AND. |
or(...filters) | Combines filters with OR. |
timeRange(start, end) | Builds a time range for queries. |
VantaError | Base error for any Vanta request failure. |
RateLimitError | HTTP 429. Exposes retryAfter. |
AuthenticationError | Raised when the API key is invalid or missing. |
vanta.shutdown() | Flushes queued data and closes the client. |
This page focuses on the Node SDK. The Web, React, and Next.js SDKs are covered on their own pages.