
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
nuxt-cloudflare-analytics
Advanced tools
Add Cloudflare Web Analytics to your Nuxt Project.
The latest versions, above 1.0.8+
are made for Nuxt 3, if you want to use nuxt 2, use 0.1.5
Note: this modules is not enabled in dev mode.
You can set environment variable NODE_ENV
to production
for testing in dev mode.
nuxt-cloudflare-analytics
dependency using yarn or npm to your project npm i nuxt-cloudflare-analytics
or yarn install nuxt-cloudflare-analytics
nuxt-cloudflare-analytics
to modules
section of nuxt.config.ts
{
// either
modules: [
[
'nuxt-cloudflare-analytics',
{
// See below for more options
token: 'your-token', // Example 1a2b3v4a5er6ac7r8afd
},
],
]
// or
modules: [
'nuxt-cloudflare-analytics'
],
cloudflareAnalytics: {
// See below for more options
token: 'your-token', // Example 1a2b3v4a5er6ac7r8afd
}
}
You can find token on Web Aalytics Page at Cloudflare Dashboard.
token
(!string)1a2b3v4a5er6ac7r8afd
scriptPath
(string | false | undefined)/_ca/b.js
. This is the beacon.min.js
from cloudflare.false
to not use a local script and instead use the CDN script (https://static.cloudflareinsights.com/beacon.min.js).
This is not recommended though, since some browsers may not load this script otherwise..js
file inside your public
folder. So if you have this file
under public/my/beacon.js
, you should set this option to my/beacon.js
.proxyPath
(string | false | undefined)false
./api
.
E.g. set proxyPath
to /api/_ca/p
, then the module will automatically
scriptPath
to use this endpoint (as long as you don't set it to something own)false
to not use a proxy and directly call cloudflare.
Be prepared that some browsers may block the request and you will not see any data.proxyPath
to false
and define a customProxyPath
(see below).customProxyPath
(string | undefined)undefined
. Only define this if you set proxyPath
to false
.// nuxt.config.ts
{
cloudflareAnalytics: {
token: 'your-token', // Example 1a2b3v4a5er6ac7r8afd
proxyPath: false,
customProxyPath: '/my-proxy'
}
}
// vercel.json
{
"rewrites": [{ "source": "/my-proxy", "destination": "https://cloudflareinsights.com/cdn-cgi/rum" }]
}
MIT © Hamjs
FAQs
Cloudflare Web Analytics Modules for NuxtJS
The npm package nuxt-cloudflare-analytics receives a total of 334 weekly downloads. As such, nuxt-cloudflare-analytics popularity was classified as not popular.
We found that nuxt-cloudflare-analytics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.