Skip to content

Vercel

Two rewrites in vercel.json, no code.

  1. Add the rewrites to vercel.json

    This works for any framework deployed on Vercel, not only Next.

    {
      "rewrites": [
        { "source": "/js/llave.js", "destination": "https://pisi.to/js/llave.js" },
        { "source": "/api/event", "destination": "https://pisi.to/api/event" }
      ]
    }
    json
  2. Point the script at your domain

    Vercel forwards X-Forwarded-For on its own, so the country holds up.

    <script defer
            data-domain="example.com"
            data-api="https://example.com/api/event"
            src="https://example.com/js/llave.js"></script>
    html

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.