Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@microsoft/applicationinsights-web
Advanced tools
Microsoft Application Insights JavaScript SDK - Web
@microsoft/applicationinsights-web is a JavaScript library that provides a way to collect and send telemetry data from web applications to Azure Application Insights. It helps in monitoring the performance, usage, and errors of web applications.
Basic Setup
This code initializes the Application Insights instance with the provided instrumentation key and tracks a page view.
const { ApplicationInsights } = require('@microsoft/applicationinsights-web');
const appInsights = new ApplicationInsights({ config: {
instrumentationKey: 'YOUR_INSTRUMENTATION_KEY'
} });
appInsights.loadAppInsights();
appInsights.trackPageView();
Custom Event Tracking
This code tracks a custom event with a name and additional properties.
appInsights.trackEvent({ name: 'myCustomEvent', properties: { customProperty: 'customValue' } });
Exception Tracking
This code tracks an exception that occurs within the application.
try {
throw new Error('Test error');
} catch (e) {
appInsights.trackException({ exception: e });
}
Dependency Tracking
This code tracks a dependency call, such as an HTTP request, with details like duration, success status, and result code.
appInsights.trackDependencyData({
id: 'uniqueId',
target: 'http://example.com',
name: 'GET /example',
duration: 300,
success: true,
resultCode: 200
});
User and Session Tracking
This code sets the authenticated user context, which helps in tracking user and session data.
appInsights.setAuthenticatedUserContext('userId', 'accountId');
Google Analytics is a widely used web analytics service that tracks and reports website traffic. It offers similar functionalities like event tracking, user tracking, and performance monitoring. However, it is more focused on marketing analytics compared to the broader application performance monitoring provided by Application Insights.
Mixpanel is an advanced analytics platform that focuses on tracking user interactions with web and mobile applications. It offers features like event tracking, user segmentation, and funnel analysis. Mixpanel is more user-centric and provides deeper insights into user behavior compared to Application Insights.
Sentry is an open-source error tracking tool that helps developers monitor and fix crashes in real-time. It provides detailed error reports, performance monitoring, and release tracking. Sentry is more focused on error and performance monitoring, whereas Application Insights offers a broader range of telemetry data.
Application Insights SDK is a package that combines commonly used packages for Web scenarios. Refer to our GitHub page for more details on getting started.
See Breaking Changes
Version | Full Size | Raw Minified | GZip Size |
---|---|---|---|
<nightly3> | |||
3.3.4: | |||
3.3.3: | |||
3.3.2: | |||
3.3.1: | |||
3.3.0: | |||
3.2.2: | |||
3.2.1: | |||
3.2.0: | |||
3.1.2: | |||
3.1.1: | |||
3.1.0: | |||
3.0.9: | |||
3.0.8: | |||
3.0.7: | |||
3.0.6: | |||
3.0.5: | |||
3.0.4: | |||
3.0.3: | |||
3.0.2: | |||
3.0.1: | |||
3.0.0: | |||
2.8.18: | |||
2.8.17: | |||
2.8.16: | |||
2.8.15: | |||
2.8.14: | |||
2.8.13: | |||
2.8.12: | |||
2.8.11: | |||
2.8.10: | |||
2.8.9: | |||
2.8.8: | |||
2.8.7: | |||
2.8.6: | |||
2.8.5: | |||
2.8.4: | |||
2.8.3: | |||
2.8.2: | |||
2.8.1: | |||
2.8.0: | |||
2.7.4: | |||
2.7.3: | |||
2.7.2: | |||
2.7.1: | |||
2.7.0: | |||
2.6.5: | |||
2.6.4: | |||
2.6.3: | |||
2.6.2: | |||
2.6.1: | |||
2.6.0: | |||
2.5.11: | |||
2.5.10: | |||
2.5.9: | |||
2.5.8: | |||
2.5.7: | |||
2.5.6: | |||
2.5.5: | |||
2.5.4: | |||
2.5.3: | |||
2.5.2: | |||
2.5.0 - 2.5.1 | Not Deployed to CDN | ||
2.4.4: | |||
2.4.3: | |||
2.4.2: | Not Deployed to CDN | ||
2.4.1: | |||
2.4.0: | Not Deployed to CDN | ||
2.3.1: | |||
2.3.0: | |||
2.2.2: | |||
2.2.1: | Not Deployed to CDN | ||
2.2.0: | |||
2.1.0: | |||
2.0.1: | |||
2.0.0: |
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement.
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.
FAQs
Microsoft Application Insights JavaScript SDK - Web
The npm package @microsoft/applicationinsights-web receives a total of 529,040 weekly downloads. As such, @microsoft/applicationinsights-web popularity was classified as popular.
We found that @microsoft/applicationinsights-web demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.