"The only analytics dashboard I open every day"

Proxy DataEasy with Next.js

Next.js rewrites forward requests transparently, without any extra server code.

next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
  async rewrites() {
    return [
      { source: "/de/js/script.js", destination: "https://dataeasy.app/js/script.js" },
      { source: "/de/api/events", destination: "https://dataeasy.app/api/events" },
    ];
  },
};

module.exports = nextConfig;

Then load the script from your own domain:

app/layout.tsx
<Script
  defer
  data-website-id="YOUR_WEBSITE_ID"
  data-domain="yourdomain.com"
  data-api-url="/de/api/events"
  src="/de/js/script.js"
  strategy="afterInteractive"
/>

If you use middleware.ts (e.g. for auth), make sure its matcher skips /de/ paths.

✍️ Something missing? Tell us.

🧭 New to DataEasy? Start with the introduction