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 / Install
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

MCP server

On this page

On this page

  • Choose an install path
  • Script tag vs npm — which should I pick?
  • Inline script — pros and cons
  • npm package — pros and cons
  • Script tag
  • Next step
DocsGetting StartedInstall

Install

Last updated July 22, 2026

Add the vTilt Browser SDK via the inline script stub (recommended default) or the npm package. Both are fully supported and expose the same API once init runs.

Add the Browser SDK one of two ways — both are fully supported and expose the same API once you call vt.init():

  • Inline script stub — recommended default. Same snippet as the dashboard Integration Script. It queues calls before array.js finishes loading (nothing is dropped during boot) and always loads the latest SDK from the CDN. No build step, no dependency to keep updated.
  • npm / pnpm package — @v-tilt/browser. A great fit when your app is already bundled and you want typed imports and a pinned version that ships in your own bundle.

Tip

If you're unsure, use the inline script — it works on any site and needs no build tooling. Choose the npm package when your app is already bundled (React, Vue, Next.js, …) and you'd rather import the SDK like any other dependency. Pick one path — don't load both (see Common mistakes).

#Choose an install path

Paste this into your HTML <head> — or copy it from Settings → Project → Integration Script in the dashboard. The loader is minified to one line (same pattern as Google's gtag.js); vt.init() follows in the same block:

<!-- prettier-ignore -->
<!-- Add to your HTML <head> -->
<script>
  !function(t,e){var o,n,p,r;function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}if(!e.__SV&&!(window.vt&&window.vt.__loaded)){window.vt=e,e._i=[],o="init capture identify setUserProperties resetUser getUserIdentity getDeviceId getUserState alias getConfig getSessionId updateConfig setConsent on once off startAutocapture stopAutocapture startSessionRecording stopSessionRecording openChat closeChat toggleChat showChat hideChat sendChatMessage gtag setGoogleUserData".split(" ");for(n=0;n<o.length;n++)g(e,o[n]);e.init=function(i,s,a){(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.script_host?s.script_host+"/array.js":s.api_host+"/dist/array.js",p.onerror=function(){console.error("vTilt: Failed to load library script:",p.src)},(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="vt",u.toString=function(t){var e="vt";return"vt"!==a&&(e+="."+a),t||(e+=" (stub)"),e},n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1}}(document,window.vt||[]);
  vt.init('YOUR_PROJECT_TOKEN', {
    api_host: 'https://www.vtilt.com',
    autocapture: true,
    capture_pageview: true,
    capture_pageleave: true,
    persistence: 'localStorage',
  });
</script>
html

The minified loader creates window.vt and queues every call; vt.init() then loads array.js and flushes the queue. For all init options see Initialize the SDK.

#Script tag vs npm — which should I pick?

Both ship the same SDK. The inline script is the recommended default; the npm package is a fully-supported alternative. Here are the trade-offs:

#Inline script — pros and cons

Pros

  • Queues early calls. identify() / capture() made before array.js loads are buffered and flushed — nothing is dropped during boot.
  • Always the latest SDK. array.js is served from the CDN, so fixes and features arrive with no version bump on your side.
  • Zero build tooling. Works on any site, including no-build and server-rendered stacks (Rails, Laravel, Django, plain HTML).
  • Sets window.vt for you; matches the dashboard Integration Script verbatim.

Cons

  • One extra network request for array.js (async, non-blocking).
  • If you call APIs very early, the stub must list every method you use (see note below).
  • You don't pin a version — you always track the latest published SDK.

#npm package — pros and cons

Pros

  • Typed imports and editor autocomplete from @v-tilt/browser.
  • Pinned version that ships inside your own bundle (reproducible builds).
  • No separate loader request — the SDK is part of your JS bundle.

Cons

  • Requires a build step / bundler.
  • You upgrade the SDK by bumping the package version yourself.
  • window.vt is not set automatically — use the imported vt, or assign it once (see the npm tab above).

Tip

You can switch paths later without changing how you call the SDK — the API is identical.

If you use the script tag and call APIs early (vt.sendChatMessage(), vt.updateConfig(…)), ensure your stub lists every method you use. The canonical set is VTILT_SNIPPET_STUB_METHOD_NAMES in @v-tilt/browser.

#Script tag

For sites without a build step, paste the stub into <head>. It creates window.vt, queues every call, and loads array.js when you call init().

The full stub (including a sample vt.init()) is in the Inline script tab above and in Settings → Project → Integration Script.

#Next step

Call vt.init() once with your project token — Initialize the SDK.

PreviousOverviewNextInitializeGetting Started