Skip to content
nuxtPublic

About

Third-Party Scripts Meets Nuxt Developer Experience.

Resources

Code of conduct

Contributing

Security policy

Stars

584 stars

Watchers

6 watching

Forks

Repository files navigation

nuxt-scripts-social-card

npm version npm downloads License Nuxt Volta Skill repository on skilld.dev

Nuxt Scripts

Better Privacy, Performance, and DX for Third-Party Scripts in Nuxt Apps.

Features

  • πŸͺ¨ Built on top of Unhead Script Loading
  • 🎁 20+ third-party scripts integrations with fine-grained performance optimizations
  • 🏎️ Performance: Self hosting, advanced script loading triggers, best-practice defaults.
  • πŸ•΅οΈ Privacy: Defaults to protect end users identity, script consent management APIs.
  • πŸͺ΅ DevTools: View your script with their status and see function logs
  • πŸš€ 0 dependencies, ~2kb minimal runtime

Background

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 solves these issues and more with the goal of making third-party scripts more performant, have better privacy and be better DX overall.

πŸš€ Quick Start

Nuxt Scripts 2 requires Nuxt ^4.7.0 || ^5.0.0 and Unhead ^3.5.0. See the installation guide for all requirements and upgrade steps.

In your Nuxt project, run:

npx nuxt@latest module add @nuxt/scripts@beta

Tip

Using an AI agent? Get the @nuxt/scripts Skill on skilld.dev/gh/nuxt/scripts/nuxt-scripts.

That's it. The Nuxt Scripts module should be downloaded and added to your Nuxt Config modules.

πŸ“¦ Examples

Explore live examples on StackBlitz:

⛰️ Next Steps

Need some inspiration to start using Nuxt Scripts? Try out the following:

  1. πŸŽ‰ Make it rain emojis with the Confetti Tutorial.
  2. πŸ“š Learn about how the Script Loading works.
  3. πŸ” Explore the Script Registry for popular pre-configured third-party scripts.
  4. πŸš€ Load other scripts with useScript or Global Scripts.
  5. πŸ”¨ Fine-tune your performance and privacy with Bundling and Consent Management.

βš–οΈ License

Licensed under the MIT license.

About

Third-Party Scripts Meets Nuxt Developer Experience.

Resources

Code of conduct

Contributing

Security policy

Stars

584 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages