Closed sfabriece closed 1 year ago
I was able to get it to work with t3 version 7.0.1.
Here is my config:
!process.env.SKIP_ENV_VALIDATION && (await import("./src/env/server.mjs"));
import { withPlausibleProxy } from "next-plausible";
/** @type {import("next").NextConfig} */
const config = withPlausibleProxy()({
reactStrictMode: true,
swcMinify: true,
i18n: {
locales: ["en"],
defaultLocale: "en",
},
headers: async () => {
return [
{
source: "/(.*)",
headers: securityHeaders,
},
];
},
});
export default config;
As for my PlausibleProvider
I have it setup like this:
<PlausibleProvider domain={domain} enabled={true}>
{getLayout(<Component {...pageProps} />)}
</PlausibleProvider>
I was not able to figure out how to have the plausible script display while I was on localhost, even though I had the trackLocalhost
set to true. However, as soon as I deployed it, I was able to see the script.
The steps outlined above work for my use case.
When creating a nextjs app with t3, it generates a
next.config.mjs
. I'm struggling to figure out how configure the proxy.