index.html at the project root as their application entry point — unlike Create React App, this file lives at the top level rather than inside public/. Pasting the Subtext capture snippet into its <head> is all you need to start recording sessions across your entire application.
You can also run
npx @subtextdev/subtext-wizard in your project root to have Subtext detect your framework and insert the snippet automatically. Follow this guide if you prefer to wire things up by hand.1
Find your Org ID
Log in to Subtext and open Settings. Your Org ID is listed in the Capture section. Copy it — you will paste it in place of
YOUR_ORG_ID in the snippet below.2
Open index.html at the project root
Open the
index.html file in the root of your Vite project (the same directory as vite.config.ts). Do not confuse this with any index.html files that may exist inside subdirectories.3
Paste the snippet into the head
Add the snippet inside the
<head> tag, just before the closing </head>. Replace YOUR_ORG_ID with the Org ID you copied from Subtext settings.index.html
Vite treats
index.html as the application entry point and processes it during both dev and build. The snippet will be included in your production build automatically — no extra configuration needed.4
Run your dev server
Start Vite with
npm run dev and open your application in a browser. The snippet loads asynchronously and does not block rendering.5
Verify capture is working
Navigate to a few pages, then open Subtext → Sessions. A new session should appear within a minute or two.
The snippet records full production sessions and masks all form inputs by default. Your agent can flag additional PII and propose masking rules for your review from within Subtext.

