Skip to content

Commit b0b365f

Browse files
authored
docs: how does it work and hooks
1 parent 9bd25fe commit b0b365f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# How does it work
2+
3+
## Server-side
4+
5+
If enabled, nuxt-applicationinisights will load nitro-applicationinsights which also loads nitro-opentelemetry.
6+
7+
This means the nitro server will be running Opentelemetry and [applicationinsights](https://github.com/microsoft/ApplicationInsights-node.js).
8+
9+
## Client-side
10+
11+
If enabled, nuxt-applicationinsights provides a plugin which initialize the [applicationinsights web sdk](https://www.npmjs.com/package/@microsoft/applicationinsights-web).
12+
13+
## API
14+
15+
nuxt-applicationinsights provides 2 plugins. One server side and another one client side.
16+
17+
The client plugin provides the ApplicationInsights instance from the web SDK. And the server side one provides the default TelemetryClient that applicationinsights node initialize (it's a singleton !).
18+
19+
Both SDK provides a similar (almost identical) API so it is easier to track any event while being in an universal component. This means you don't have to worry about whether it will work in one environment or not.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
| name | type | Description |
2+
| ---------------------------------- | --------------------------- | -------------------------------------------------------------------------- |
3+
| `applicationinsights:config:clien` | `(config: Snippet) => void` | Called when before creating the `ApplicationInsights` instance |
4+
| `applicationinsights:load:error` | `(e: Error) => void` | Called if something's wrong with the initialization of ApplicationInsights |
5+
6+
## Nitro hooks
7+
8+
See [nitro-applicationinsights](https://huang-julien-nitro-applicationinsights.nuxt.space/) and [nitro-opentelemetry](https://github.com/huang-julien/nitro-opentelemetry).

0 commit comments

Comments
 (0)