# applicationinsightsfornuxt

> Applicationin Insights module for Nuxt.js

Latest version **1.4.5** (published 2020-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install applicationinsightsfornuxt
pnpm add applicationinsightsfornuxt
yarn add applicationinsightsfornuxt
bun add applicationinsightsfornuxt
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.5 |
| Published | 2020-09-03 |
| First published | 2019-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | jeverduzco |

## Links

- npm: https://www.npmjs.com/package/applicationinsightsfornuxt
- Repository: https://github.com/jeverduzco/applicationinsightsfornuxt
- Homepage: https://github.com/jeverduzco/applicationinsightsfornuxt#readme
- Issues: https://github.com/jeverduzco/applicationinsightsfornuxt/issues
- npm.io page: https://npm.io/package/applicationinsightsfornuxt

## Dependencies (4)

- [consola](https://npm.io/package/consola.md) ^2.15.0
- [deepmerge](https://npm.io/package/deepmerge.md) ^4.2.2
- [applicationinsights](https://npm.io/package/applicationinsights.md) ^1.8.5
- [@microsoft/applicationinsights-web](https://npm.io/package/@microsoft/applicationinsights-web.md) ^2.5.8

## Recent versions

- 1.4.5 (latest) — 2020-09-03
- 1.4.4 — 2020-09-03
- 1.4.3 — 2020-07-16
- 1.4.2 — 2020-05-15
- 1.4.1 — 2020-04-10
- 1.4.0 — 2019-09-14
- 1.3.0 — 2019-09-14
- 1.2.0 — 2019-09-14
- 1.1.0 — 2019-09-14
- 1.0.0 — 2019-09-14

## README

# applicationinsightsfornuxt

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Standard JS][standard-js-src]][standard-js-href]

> ApplicationInsights module for Nuxt.js

## Features

The module enables event logging through [Application Insights](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview).

## Setup
- Add `applicationinsightsfornuxt` dependency using npm to your project
- Add `applicationinsightsfornuxt` to `modules` section of `nuxt.config.js`

```js
{
  modules: [
    'applicationinsightsfornuxt',
  ],

  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](https://github.com/Microsoft/ApplicationInsights-node.js#advanced-configuration-options) and [client](https://github.com/microsoft/ApplicationInsights-JS#configuration).

### 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

### 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](./LICENSE)

This module has been based on: https://github.com/nuxt-community/applicationinsights-module
And adapted to meet the needs of my projects.

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/dt/applicationinsightsfornuxt.svg?style=flat-square
[npm-version-href]: https://npmjs.com/package/applicationinsightsfornuxt
[npm-downloads-src]: https://img.shields.io/npm/v/applicationinsightsfornuxt/latest.svg?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/applicationinsightsfornuxt
[standard-js-src]: https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square
[standard-js-href]: https://standardjs.com

---
_Source: https://npm.io/package/applicationinsightsfornuxt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
