1
Add rewrites
In If your app already uses
next.config.js:next.config.js
/api/events, choose another path such as /trfyx-events and set data-api-url to that path.2
Update the tracker
pages/_app.tsx
src is same-origin, Trfyx sends events to /api/events by default.3
Verify installation
Deploy your application, open the browser Network panel, and confirm both
script.js and /api/events are requested from your domain. Then check that the activity appears in Trfyx.