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 / Error tracking
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

  • captureException
  • Forwarding end-user context
DocsAPI ReferenceNode SDKError tracking

Error tracking

Last updated July 22, 2026

Capture server-side exceptions as $exception events with normalized type, message and stack trace.

Capture errors from your backend as $exception events. The error is normalized into $exception_type, $exception_message, and $exception_stack_trace_raw.

#captureException

try {
  await processPayment(order)
} catch (err) {
  vtilt.captureException(err, {
    distinctId: 'user_123',
    properties: { order_id: order.id },
  })
}
typescript

distinctId is optional but recommended so the exception is attributed to a person. Non-Error values (strings, objects) are accepted and coerced into a message.

In serverless / edge handlers, use captureExceptionImmediate() to send before the runtime is frozen:

export default {
  async fetch(req, env, ctx) {
    try {
      return await handle(req)
    } catch (err) {
      await vtilt.captureExceptionImmediate(err)
      throw err
    }
  },
}
typescript

#Forwarding end-user context

If your handler knows the end user's IP / User-Agent, forward them so the exception is geolocated and attributed the same way a captured event would be:

vtilt.captureException(err, {
  distinctId: 'user_123',
  ip: req.ip,
  userAgent: req.headers['user-agent'],
})
typescript

Note

This SDK captures exceptions you pass explicitly. It does not install global uncaughtException / unhandledRejection handlers — wire those up yourself if you want automatic capture, and call captureExceptionImmediate() from within them.

PreviousGlobal properties & opt-outNode SDKNextOverviewMCP server