
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
nuxt-fathom
Advanced tools
Nuxt module to integrate Fathom Analytics.
.env
file support# pnpm
pnpm add -D nuxt-fathom
# npm
npm i -D nuxt-fathom
# yarn
yarn add -D nuxt-fathom
Add nuxt-fathom
to the modules
section of your Nuxt configuration and provide your Fathom site ID.
// `nuxt.config.ts`
export default defineNuxtConfig({
modules: ["nuxt-fathom"],
fathom: {
siteId: "FATHOM_SITE_ID",
},
});
Tip: you can also use an .env file instead of a
fathom
key.
Done! Fathom Analytics will now run in your application's client.
All supported module options can be configured using the fathom
key in your Nuxt configuration:
export default defineNuxtConfig({
modules: ['nuxt-fathom'],
fathom: {
// The Fathom Analytics site ID to use for tracking
siteId: string,
// Additional configuration
config: {
manual?: boolean
auto?: boolean
honorDNT?: boolean
canonical?: boolean
spa?: 'auto' | 'history' | 'hash'
}
}
})
Instead of hard-coding your Fathom Analytics site ID in your Nuxt configuration, you can set your desired option in your project's .env
file, leveraging automatically replaced public runtime config values by matching environment variables at runtime.
# Overwrites the `fathom.siteId` module option
NUXT_PUBLIC_FATHOM_SITE_ID=YOUR_SITE_ID
With this setup, you can omit the fathom
key in your Nuxt configuration if you only intend to set the site ID.
Property | Type | Description | Default |
---|---|---|---|
manual | boolean | If you want to manually control page view tracking. | false |
auto | boolean | When false , skips automatically tracking page views on script load. | true |
honorDNT | boolean | When true , honors the DNT header in the visitor's browser. | false |
canonical | boolean | When false , ignores the canonical tag if present. | true |
spa | 'auto', 'history', 'hash' | Accepts one of the following values: auto, history, or hash (see advanced docs). | undefined |
As with other composables in the Nuxt 3 ecosystem, they are auto-imported and can be used in your application's components.
useFathom
The SSR-safe useFathom
composable provides access to:
blockTrackingForMe
method.enableTrackingForMe
method.isTrackingEnabled
method.setSite
method.trackEvent
method.trackPageview
method.It can be used as follows:
// Each method is destructurable from the composable
const {
blockTrackingForMe,
enableTrackingForMe,
isTrackingEnabled,
setSite,
trackEvent, // The method most likely to be used.
trackPageview,
} = useFathom();
[!NOTE] Since the
fathom
instance is available in the client only, anyuseFathom
method calls executed on the server will have no effect.
# Install dependencies
pnpm install
# Generate type stubs
pnpm run dev:prepare
# Develop with the playground
pnpm run dev
# Build the playground
pnpm run dev:build
# Run ESLint
pnpm run lint
# Run Vitest
pnpm run test
pnpm run test:watch
# Release new version
pnpm run release
FAQs
Fathom analytics Nuxt module
The npm package nuxt-fathom receives a total of 1,451 weekly downloads. As such, nuxt-fathom popularity was classified as popular.
We found that nuxt-fathom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.