Skip to main content
The Subtext capture snippet is a short piece of JavaScript you add to your application’s HTML <head>. When a user visits a page that carries it, the snippet bootstraps an async loader, fetches fs.js from Fullstory’s edge network, and begins recording the session — all without blocking the page render. Every click, scroll, navigation, network request, and console error flows into a structured event stream that your AI coding agent can query through Subtext’s MCP tools. Because the snippet is async and lightweight, you can run it on every production session without any meaningful performance cost.
Subtext is built on Fullstory’s capture infrastructure. The snippet points at edge.fullstory.com/s/fs.js — the same delivery network behind Fullstory’s enterprise session replay. You get that reliability and global reach without needing a separate Fullstory account; Subtext manages the integration for you.

What the snippet records

Once loaded, the snippet captures:
  • DOM mutations and layout — the full visual state of every page, reconstructed accurately in replay
  • User interactions — clicks, taps, keyboard events, scrolls, focus changes, and form submissions
  • Navigation — page loads, client-side route changes (including SPAs), and redirects
  • Network activity — XHR and Fetch requests with timing and status codes
  • Console output — errors, warnings, and log messages correlated to the timeline
  • JavaScript exceptions — uncaught errors with stack traces, timestamped against the session
Form inputs — <input>, <textarea>, <select> — are masked from first install. The text your users type never leaves the browser. You can extend masking to other elements using CSS selectors after install; Subtext’s privacy tools let your agent propose and promote those rules without manual configuration.

What the snippet looks like

Every Subtext snippet follows the same structure. Your organisation ID and namespace are baked in at install time; the loader itself is boilerplate that stays identical across all projects.
Replace YOUR_ORG_ID with the organisation ID from your Subtext dashboard. If you used the setup wizard, this replacement was made automatically.

How to detect if the snippet is already installed

Before adding the snippet, check whether your app already loads fs.js. Look for any of these signals:
  • Search your codebase for edge.fullstory.com or _fs_org — if either string appears, the snippet (or Fullstory’s own snippet) is already present
  • Open your browser’s Network tab, load a page, and filter by fs.js — a 200 response confirms capture is running
  • Check your <head> template, root layout file, or tag manager configuration for a script referencing fullstory.com
If the snippet is already present from a prior Fullstory install, Subtext can connect to those existing sessions — you do not need a second copy of the script.

Framework installation guides

Where exactly the snippet goes depends on your framework’s rendering model. Click the guide for your stack:
For Single Page Apps (React, Vite, Remix), the snippet only needs to appear once — in the root HTML shell. You do not need to add it to individual route components. Client-side navigations are tracked automatically as part of the session.

Next steps

Once the snippet is in place and you have deployed your app, sessions begin recording immediately. Your next step is connecting your AI coding agent to those sessions via the MCP server. See the installation overview for the full picture, or jump straight to the MCP setup guide for your agent.