Vercel
Two rewrites in vercel.json, no code.
Add the rewrites to vercel.json
This works for any framework deployed on Vercel, not only Next.
json{ "rewrites": [ { "source": "/js/llave.js", "destination": "https://pisi.to/js/llave.js" }, { "source": "/api/event", "destination": "https://pisi.to/api/event" } ] }Point the script at your domain
Vercel forwards X-Forwarded-For on its own, so the country holds up.
html<script defer data-domain="example.com" data-api="https://example.com/api/event" src="https://example.com/js/llave.js"></script>
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.