vTilt
By roleFoundersKnow what to fix firstMarketersSee what happens after the clickCMOsSee what your budget really buys
By businessSaaSTurn signups into active usersEcommerceSee why shoppers abandon cartsAgenciesProve your work to clientsEnterpriseOne customer record for every team
MeasureWeb AnalyticsFind where buyers leaveSession ReplaySee why they left, not just that they didAdsKnow what paid visitors do nextIntegrationsOne snippet feeds your stack
ThinkPeopleOne profile per customerCustomer MemoryvTilt remembers every visitorSite KnowledgeAnswers and audits from your own pages
ActAsk AIAnswers from real behaviorAI ChatChat that knows the visitorEmail CampaignsEmail from real visits
PricingWhy vTiltDocs
Docs / Capture, identify & alias
Getting Started
OverviewInstallInitializeIdentify usersTrack eventsLogout & resetVerify eventsCommon mistakes
Guides
Event forwardingReverse proxyRealtime dashboardSite knowledge
Frontend frameworks
Next.jsNuxt.jsVue.jsReactReact RouterRemixGatsbySvelte / SvelteKitAstroAngularTanStack StartDocusaurus
Backend frameworks
NestJSHonoCloudflare WorkersDjangoFlaskLaravelPhoenixRuby on Rails
Backend languages
PythonPHPRubyElixirGoJava.NET / C#Rust
Stack guides
Vue + PHP
API Reference
Browser SDK
Script bundlesAutocaptureWeb VitalsSession recordingChat widgetFeature readinessRemote configurationDebug logging
Node SDK
Install & setupCapture, identify & aliasContext & shutdownGlobal properties & opt-outError tracking
MCP server
Guides
OverviewAuthenticationOAuthAgent skills (prompts)AI intelligenceSite knowledgeGoogle AdsMeta Ads
Client setup
CursorClaude DesktopVS CodeCodex

Getting Started

OverviewInstallInitializeIdentify usersTrack eventsLogout & resetVerify eventsCommon mistakes

Guides

Event forwardingReverse proxyRealtime dashboardSite knowledge

API Reference

Install & setupCapture, identify & aliasContext & shutdownGlobal properties & opt-outError tracking

MCP server

On this page

On this page

  • Capture
  • Geolocation & end-user metadata
  • Identify
  • Alias
DocsAPI ReferenceNode SDKCapture, identify & alias

Capture, identify & alias

Last updated July 22, 2026

Server-side capture(), identify(), alias() — same shapes as the browser, with explicit ids on every call.

Same API as the browser: capture(), identify(), alias(). Pass distinctId (and optional anonymousId) per call or via setContext().

#Capture

Send custom events. Include anonymousId when linking to browser sessions — for example, when a server-side webhook needs to attach to a still-anonymous browser visitor.

vtilt.capture({
  distinctId: 'user_123',
  event: 'purchase',
  properties: { amount: 99.99 },
  anonymousId: 'anon_from_browser', // optional, for linking
})
typescript

Every event automatically carries $lib, $lib_version, and a generated $insert_id. For serverless/edge handlers where there may be no later flush, use captureImmediate() (also identifyImmediate / aliasImmediate), which sends a single event and resolves when the request completes:

await vtilt.captureImmediate({
  distinctId: 'user_123',
  event: 'webhook_received',
})
typescript

#Geolocation & end-user metadata

A server can't observe the visitor's browser, so the SDK never sends $browser / $os / device properties. It can geolocate the visitor and record their original User-Agent / referrer — but only if you forward them from the incoming request:

vtilt.capture({
  distinctId: 'user_123',
  event: 'page_view',
  ip: req.ip, // -> $ip, enables GeoIP exactly like the browser
  userAgent: req.headers['user-agent'], // optional -> $raw_user_agent
  referrer: req.headers['referer'], // optional -> $referrer
})
typescript

GeoIP is smart by default: it runs only when an ip is available. When you don't forward one, the SDK disables GeoIP so your own server's IP is never geolocated. You can set these once per request with setContext().

#Identify

Attach properties to a person record. Pass anonymousId to link an anonymous browser session to its newly-authenticated identity (e.g. immediately after login). The merge behaviour is the same as the browser identify() — see Browser SDK / Identify & alias for the full model.

vtilt.identify({
  distinctId: 'user_123',
  anonymousId: 'anon_from_cookie', // optional, for merge
  properties: { name: 'Alice', plan: 'pro' },
})
typescript

#Alias

Link two distinct ids — for example, joining a legacy auth id with a new SSO id, or stitching two known accounts together.

vtilt.alias({
  distinctId: 'user_123',
  alias: 'legacy_id_456',
})
typescript

Note

Use identify() for "anonymous → known" merges and alias() for "known A → known B" links. Mixing them up doesn't fail loudly but produces confusing person records.

PreviousInstall & setupNode SDKNextContext & shutdownNode SDK