A lightweight, framework-independent Application Insights REST API client for Node.js, optimized for Nuxt 4 and modern frameworks. Version 0.2.3 is current (released intermittently on GitHub). It supports full telemetry (events, requests, dependencies, exceptions, traces, metrics) with automatic batching and retry, zero core dependencies, and TypeScript types. Unlike the official @microsoft/applicationinsights-web SDK, this focuses on server-side telemetry with a simple synchronous API queued for batch delivery.
npm install appinsights-restNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to initialize AppInsightsLogger with connection string, track events, requests, exceptions, and clean up with dispose.
Use 'import' syntax or dynamic import. For CommonJS projects, set type: module or use .mjs extension.
Call await logger.dispose() or logger.flush() (if exposed) to ensure all queued telemetry is sent before process exit.
Always set APPLICATIONINSIGHTS_CONNECTION_STRING environment variable or pass connectionString to constructor.
Replace correlationId with operationId in RequestTelemetry options.
Upgrade to Nuxt 4 or use the framework-independent core without Nuxt module.
Change require to import: import { AppInsightsLogger } from 'appinsights-rest'Set env variable or pass connectionString: process.env.APPLICATIONINSIGHTS_CONNECTION_STRING ?? ''
Run npm install appinsights-rest and ensure import path is correct.