Run one of the following commands to add the module to your project:
npm install nuxt-tawk-to
pnpm add nuxt-tawk-to
yarn add nuxt-tawk-to
bun add nuxt-tawk-to
Add nuxt-tawk-to to the modules array in your nuxt.config.ts and provide your Tawk.to credentials:
export default defineNuxtConfig({
modules: ['nuxt-tawk-to'],
tawkTo: {
propertyId: 'your-tawk-property-id',
widgetId: 'your-widget-id'
}
})
That's it. The Tawk.to widget will load automatically on the client side.
The tawkTo config key accepts the following options:
| Option | Type | Required | Description |
|---|---|---|---|
propertyId | string | ✅ | Your Tawk.to property ID. |
widgetId | string | ✅ | Your Tawk.to widget ID. |
propertyId or widgetId is missing, the module will print a warning and skip widget injection.Once registered, the module automatically:
window.Tawk_API initializer script in your app's <head>.embed.tawk.to.useTawk() composable across your entire app.