2

I have an application deployed to Vercel using SvelteKit and would like to enable Web Vitals in the Vercel dashboard. I go in and enable it, redeploy, and then visit the site but it just keeps waiting for incoming data. I have CSP configuration in my svelte config file that looks like this:

kit: {
        adapter: vercel(),
        csp: {
            mode: "auto",
            directives: {
                "script-src": [
                    "self",
                    "vitals.vercel-insights.com",
                    "cdn.vercel-insights.com",
                    "vercel.live"
                ]
            },
            reportOnly: {
                "script-src": [
                    "self",
                    "vitals.vercel-insights.com",
                    "cdn.vercel-insights.com",
                    "vercel.live"
                ],
                "report-uri": [
                    `REDACTED`
                ]
            }
        }
    }

Any thoughts on how to get it working would be appreciated. Thanks

  • Are you sure Web Vitals is supported for SvelteKit? The docs indicate that it only supports Next.js, Nuxt.js, and Gatsby, otherwise you'll need to manually configure the Web Vitals API: https://vercel.com/docs/concepts/analytics/quickstart#supported-frameworks – Rick Viscomi Feb 23 '23 at 13:33
  • @RickViscomi Thanks, somehow I didn't see that. I found an official Vercel repo with the SvelteKit config for it. – Drew Worden Feb 23 '23 at 23:59

0 Answers0