Next.js
Rewrites in next.config.ts, no extra server.
Add the rewrites to next.config.ts
Works the same on Vercel, on your own Node, or in Docker.
ts// next.config.ts import type { NextConfig } from "next"; const nextConfig: NextConfig = { async rewrites() { return [ { source: "/js/llave.js", destination: "https://pisi.to/js/llave.js" }, { source: "/api/event", destination: "https://pisi.to/api/event" }, ]; }, }; export default nextConfig;Point the Script at your domain
The same component as the Next guide, with src and data-api on your domain.
tsx<Script defer data-api="/api/event" data-domain="example.com" src="/js/llave.js" strategy="afterInteractive" />
Check that it works
Open your site in a new tab and watch the dashboard: you should show up under "home right now" in under ten seconds. If you do not, run through the onboarding checklist.