There is a first-class Nuxt integration for partytown.


Add @nuxtjs/partytown dependency to your project.

yarn add --dev @nuxtjs/partytown # or npm install --save-dev @nuxtjs/partytown


Add @nuxtjs/partytown to the modules section of nuxt.config.ts. Use the partytown property for the configuration.

import { defineNuxtConfig } from 'nuxt';

export default defineNuxtConfig({
  modules: ['@nuxtjs/partytown'],
  partytown: {
    /* any partytown-specific configuration */

Partytown Script

Add type: 'text/partytown' attribute to any scripts you want to be handled by partytown.

    <Script type="text/partytown" src="" />

Note that the Nuxt Partytown module already handles copying the library files to the correct location.

Made with ❤️ by

© 2024, Inc.

Introducing Visual Copilot.

100% free. Supports all popular frameworks.

Try Visual Copilot