Agent skill · Data & Analytics

applicationinsights-web-ts

Instrument browser/web apps with the Application Insights JavaScript SDK (@microsoft/applicationinsights-web). Use for Real User Monitoring (RUM) — page views, clicks, AJAX/fetch dependencies, exceptions, custom events, and browser-side GenAI agent traces correlated to backend OpenTelemetry traces. Covers SDK Loader Script and npm setup, framework extensions (React, React Native, Angular), Click Analytics, telemetry initializers, and OTel GenAI semantic conventions for agent/tool/model spans emitted from the browser.

Microsoft293,217★ · +1,988/wk · 14 repos on radarProfile →
copilotMIT
Install
npx skills add microsoft/skills --skill applicationinsights-web-ts --agent copilot

Same command for any agent — swap --agent for claude-code, codex, cursor.

Facts
Files in the skill folder: 4
SKILL.md size: 20 KB
Bundled scripts: none
Version: 1.0.0
Declared author: Microsoft
Path: .github/skills/applicationinsights-web-ts/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 2,860
Language: TypeScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Instructs the agent to set up Real User Monitoring (RUM) for browser/web applications using the Application Insights JavaScript SDK. It covers core telemetry (page views, AJAX/fetch dependencies, exceptions), optional plugins (click analytics, React, React Native, Angular), and GenAI agent traces that follow OpenTelemetry conventions. Includes guidance on installation, loader script usage, and framework extensions. Also defines how to emit and correlate GenAI-related dependencies with backend spans via distributed tracing.

How it works

The skill prescribes:

  • Install core and optional plugins via npm commands, including creating and configuring an ApplicationInsights instance with a config object that enables features like enableAutoRouteTracking, enableCorsCorrelation, distributedTracingMode, and various tracking toggles.
  • Use the Quick Start code to instantiate ApplicationInsights, load it, and call trackPageView and other track* methods as appropriate.
  • Provide a Loader Script snippet to load the SDK from a CDN, with a queue of API methods that executes once the SDK is ready.
  • Use Core Tracking APIs to send page views, events, exceptions, traces, metrics, and dependencies, including optional parameters for IDs, names, durations, and additional properties.
  • Add Telemetry Initializers to enrich telemetry items and optionally drop items by returning false.
  • Enable Click Analytics via the ClickAnalyticsPlugin and mark elements with data-ai-* attributes.
  • Enable SPA route tracking via enableAutoRouteTracking or Manual trackPageView calls on route changes.
  • Configure distributed tracing (distributedTracingMode: 2) to attach traceparent to outbound calls and correlate with backend OpenTelemetry spans.
  • Emit GenAI agent traces using OpenTelemetry GenAI semantic conventions, with an opt-in environment variable and a pattern for invoking agents and nested tool/model spans; send GenAI-related dependencies and handle errors.
  • Provide Kusto query example to analyze GenAI traces.
  • Include framework-specific snippets for React (withAITracking) and references to framework extensions.

When to use it

Use when you need browser/web telemetry with automatic and manual tracking for user interactions, network calls, errors, and GenAI agent traces that should correlate with backend traces. Activate if you require cross-origin correlation, SPA route tracking, and optional ecosystem plugins (Click Analytics, React/Angular plugins).

What it can touch

  • Core library: @microsoft/applicationinsights-web.
  • Optional plugins: @microsoft/applicationinsights-clickanalytics-js, @microsoft/applicationinsights-react-js, @microsoft/applicationinsights-react-native, @microsoft/applicationinsights-angularplugin-js, @microsoft/applicationinsights-debugplugin-js, @microsoft/applicationinsights-perfmarkmeasure-js.
  • It references environment variables (e.g., VITE_APPINSIGHTS_CONNECTION_STRING, NEXT_PUBLIC_APPINSIGHTS_CONNECTION_STRING) and code APIs like ApplicationInsights, trackPageView, trackEvent, trackException, trackDependencyData, setAuthenticatedUserContext, flush, and addTelemetryInitializer.

Caveats

  • The browser SDK requires a plaintext connection string at init time; Entra ID auth is not supported for browser telemetry.
  • GenAI traces require explicit opt-in and follow OpenTelemetry GenAI semantic conventions; sensitive content fields are opt-in and should be gated.
  • Some features depend on build setup and framework integration (e.g., React Router or React Native plugins) and may require additional configuration per framework.
  • Loader Script usage bypasses build pipelines and relies on CDN delivery; consider security and versioning implications.
From the SKILL.md

# Application Insights JavaScript SDK (Web) for TypeScript Real User Monitoring (RUM) for browser apps with `@microsoft/applicationinsights-web`. Auto-collects page views, AJAX/fetch dependencies, unhandled exceptions, and (with the Click Analytics plugin) clicks. Supports custom events, metrics, and **GenAI agent traces** that follow OpenTelemetry GenAI semantic conventions and correlate to backe

More from skills
All skills →
About this skill
What does the applicationinsights-web-ts skill do?

Instrument browser/web apps with the Application Insights JavaScript SDK (@microsoft/applicationinsights-web). Use for Real User Monitoring (RUM) — page views, clicks, AJAX/fetch dependencies, exceptions, custom events, and browser-side GenAI agent traces correlated to backend OpenTelemetry traces. Covers SDK Loader Script and npm setup, framework extensions (React, React Native, Angular), Click Analytics, telemetry initializers, and OTel GenAI semantic conventions for agent/tool/model spans emitted from the browser.

How do I install it?

Run `npx skills add microsoft/skills --skill applicationinsights-web-ts --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From microsoft/skills, a repository with 2,860 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going