React Router and Remix
npx @plaintrace/cli init --site <site id> --endpoint https://collect.plaintrace.devThe CLI adds the script to app/root.*. By hand, put it in the <head> of your root layout:
<head> <Meta /> <Links /> <script async src="https://collect.plaintrace.dev/t.js" data-site="<site id>" /></head>Client-side navigations are recorded as soft page views automatically.
For events, use @plaintrace/browser or window.px once the script has loaded.
The server SDK runs in your server entry or adapter, before the request reaches the app.