New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@microsoft/applicationinsights-dependencies-js

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/applicationinsights-dependencies-js

Microsoft Application Insights XHR dependencies plugin


Version published
Weekly downloads
570K
decreased by-0.5%
Maintainers
2
Weekly downloads
 
Created

What is @microsoft/applicationinsights-dependencies-js?

@microsoft/applicationinsights-dependencies-js is a JavaScript library that provides automatic collection of dependency telemetry for applications using Application Insights. It helps in tracking HTTP dependencies and AJAX calls, allowing developers to monitor the performance and reliability of their web applications.

What are @microsoft/applicationinsights-dependencies-js's main functionalities?

Track HTTP Dependencies

This feature allows you to track HTTP dependencies automatically. By integrating the AjaxPlugin with Application Insights, you can monitor all HTTP requests made by your application.

const { ApplicationInsights } = require('@microsoft/applicationinsights-web');
const { AjaxPlugin } = require('@microsoft/applicationinsights-dependencies-js');

const appInsights = new ApplicationInsights({
  config: {
    instrumentationKey: 'YOUR_INSTRUMENTATION_KEY',
    extensions: [new AjaxPlugin()]
  }
});
appInsights.loadAppInsights();
appInsights.trackPageView();

Track AJAX Calls

This feature allows you to track AJAX calls made by your application. The AjaxPlugin automatically captures and logs these calls, providing insights into the performance and reliability of your AJAX requests.

const { ApplicationInsights } = require('@microsoft/applicationinsights-web');
const { AjaxPlugin } = require('@microsoft/applicationinsights-dependencies-js');

const appInsights = new ApplicationInsights({
  config: {
    instrumentationKey: 'YOUR_INSTRUMENTATION_KEY',
    extensions: [new AjaxPlugin()]
  }
});
appInsights.loadAppInsights();

// Example AJAX call
const xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.example.com/data', true);
xhr.send();

Other packages similar to @microsoft/applicationinsights-dependencies-js

FAQs

Package last updated on 21 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts