@nuxtjs/applicationinsights

AppInsights module for Nuxt.js
25,108 18
Install
npm install @nuxtjs/applicationinsights
Latest Version:2.0.10
Vue:3
License:MIT
Last Updated:Oct 13, 2026
Links: GitHub  ·  npm

@nuxtjs/applicationinsights

npm version npm downloads Circle CI Codecov Dependencies Standard JS

ApplicationInsights module for Nuxt 2

Features

The module enables event logging through Application Insights.

Setup

  • Add @nuxtjs/applicationinsights dependency using yarn or npm to your project
  • Add @nuxtjs/applicationinsights to modules section of nuxt.config.js
{
  modules: [
    '@nuxtjs/applicationinsights',
  ],

  appInsights: {
    instrumentationKey: '' //  your project's Instrumentation Key here
  }
}

Nuxt compatibility

Versions of NuxtJS before v2.4.0 are not supported by this package.

Usage

Enter your Instrumentation Key in the NuxtJS config file. Additional config settings can be found server and client.

Usage in Vue component

In a Vue component, Application Insights is available as this.$appInsights, so we can call functions like

this.$appInsights.trackTrace({message: 'This message will use a telemetry initializer'})

where this is a Vue instance.

Options

Options can be passed using either environment variables or appInsights section in nuxt.config.js. Normally setting required Instrumentation Key information would be enough.

instrumentationKey

  • Type: String
    • Default: process.env.APPINSIGHTS_INSTRUMENTATION_KEY || false
    • If no instrumentationKey is provided module wont work

serverConnectionString

  • Type: String
    • Default: process.env.APPINSIGHTS_CONNECTION_STRING || false
    • If no serverConnectionString is provided server side wont work

disabled

  • Type: Boolean
    • Default: process.env.APPINSIGHTS_DISABLED || false
    • ApplicationInsights will not be initialised if set to true.

disableClientSide

  • Type: Boolean
    • Default: process.env.APPINSIGHTS_DISABLE_CLIENT_SIDE || false

disableServerSide

  • Type: Boolean
    • Default: process.env.APPINSIGHTS_DISABLE_SERVER_SIDE || false

initialize

  • Type: Boolean
    • Default: process.env.APPINSIGHTS_INITIALIZE || true

trackPageView

  • Type: Boolean
    • Default: process.env.APPINSIGHTS_TRACK_PAGE_VIEW || true

serverConfig

  • Type: Object
    • Default: { }
    • If specified, values will override config values for server Application Insights plugin

clientConfig

  • Type: Object
    • Default: { }
    • If specified, values will override config values for client Application Insights plugin

License

MIT License

Copyright (c) Dmitry Molotkov aldarund@gmail.com

Related Packages

@nuxtjs/i18n

Internationalization for Nuxt

23,877,608 2,085
@nuxtjs/color-mode

Dark and light mode for Nuxt with auto detection

20,659,199 1,228
@nuxtjs/tailwindcss

Tailwind CSS module for Nuxt

16,852,917 1,868
@nuxtjs/sitemap

Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.

8,341,086 441
@nuxtjs/mdc

Nuxt MDC module

7,786,445 400

Version History

Version Released Vue License
2.0.10 ^3.0 MIT
2.0.8 ^3.0 MIT
2.0.7 ^3.0 MIT
2.0.6 ^3.0 MIT
2.0.5 ^3.0 MIT