Proxy guides

Next.js

Proxy StatSip through Next.js rewrites.

Add rewrites so /t.js and /api/event on your site are fetched from StatSip. Do this only if those paths are free.

next.config.ts
async rewrites() {
  return [
    { source: "/t.js", destination: "https://statsip.com/t.js" },
    { source: "/api/event", destination: "https://statsip.com/api/event" },
  ];
}
html
<script defer src="/t.js" data-site="YOUR_SITE_KEY"></script>

Something unclear or missing? Tell us.