# First-party proxy

Serve /cashline.js and /api/collect on the origin you measure. Zarstat does not sell a managed proxy. localStorage visitor_id is still per origin.

Next.js rewrite (docs only):

async rewrites() {
  return [
    { source: "/cashline.js", destination: "https://www.zarstat.co.za/cashline.js" },
    { source: "/api/collect", destination: "https://www.zarstat.co.za/api/collect" },
  ];
}

nginx: proxy those two paths. www and app stay different visitors.

HTML twin: https://www.zarstat.co.za/docs/proxy
