
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@nuxt/scripts
Advanced tools
Powerful DX improvements for loading third-party scripts in Nuxt.
All the features from Unhead useScript:
defer
, fetchpriority: 'low'
, early connections (preconnect
, dns-prefetch
)idle
, manual
, Promise
onload
, onerror
, etcPlus Nuxt goodies:
useTrackingScript
- Load a tracking script while respecting privacy and consent@nuxt/scripts
dependency to your project:pnpm add -D @nuxt/scripts
#
yarn add -D @nuxt/scripts
#
npm install -D @nuxt/scripts
modules
section in your nuxt.config
:export default defineNuxtConfig({
modules: ['@nuxt/scripts']
})
Loading third-party IIFE scripts using useHead
composable is easy. However,
things start getting more complicated quickly around SSR, lazy loading, and type safety.
Nuxt Scripts was created to solve these issues and more with the goal of making third-party scripts a breeze to use.
useScript
Please see the useScript documentation.
useTrackingScript
This composables is a wrapper around useScript
that respects privacy and cookie consent.
For the script to load you must provide a consent
option. This can be promise, ref, or boolean.
const agreedToCookies = ref(false)
useTrackingScript('https://www.google-analytics.com/analytics.js', {
// will be loaded in when the ref is true
consent: agreedToCookies
})
If the user has enabled DoNotTrack
within their browser, the script will not be loaded, unless
explicitly ignoring.
const agreedToCookies = ref(false)
useTrackingScript('https://www.google-analytics.com/analytics.js', {
ignoreDoNotTrack: true
})
Licensed under the MIT license.
FAQs
Load third-party scripts with better performance, privacy and DX in Nuxt Apps.
The npm package @nuxt/scripts receives a total of 75,533 weekly downloads. As such, @nuxt/scripts popularity was classified as popular.
We found that @nuxt/scripts demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.