Context

Automatic metadata attached to every event.

Context is metadata that Vanta attaches to every event automatically. You don't configure it.

What's captured

Browser: name and version

OS: name and version

Device: desktop, mobile, or tablet

Screen: width and height

Viewport: width and height

Language: browser language

Timezone: user timezone

URL: current page URL

Referrer: referring URL

The API also adds:

IP address: from request headers

Locale: from Accept-Language header

How it works

When you send an event, the SDK collects browser information and attaches it as the context field. The API adds server-side context (IP, locale) before storing.

Custom context

Override or extend automatic context by passing your own context:

typescript: await vanta.track({
await vanta.track({
  event: 'purchase',
  context: {
    plan: 'premium',
    feature: 'export'
  }
})

Your custom fields merge with the automatic context.