Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cordova-plugin-ms-appinsights
Advanced tools
This plugin allows you to add an Application Insights to your Apache Cordova app. Application Insights is a techonogy that sends telemetry from your app to the Azure portal.
More info about Application Insights technology could be found here
To use this plugin you'll need an account in Microsoft Azure. You might already have access to a group account through your organization, or you might want to get a Pay-as-you-go account. (While Application Insights is in Preview, it's free.)
For more API documentation see sample application and JSDoc for exposed functionality stored in www subfolder.
Application Insights API is available through window.appInsights
object. To start using it you don't have to initialize it, just start calling its' methods
// This will send a custom-defined event to your appInsights account
var eventData = { ButtonId: "trackSingleEvent", Timestamp: new Date() };
appInsights.trackEvent('click', eventData);
// This will send data about how long some action is performed
appInsights.startTrackEvent("longRunningTask");
// Emulate some long-running action through `setTimeout`
setTimeout(function () {
// When task is finished, call 'stopTrackEvent' with the same event as in 'startTrackEvent'
appInsights.stopTrackEvent("longRunningTask");
}, 10000);
// This will send an exception information to your appInsights account
try {
// Do some logic here which may
throw new Error("Sample Error");
} catch (err) {
// Catch an error and send it to appInsights
appInsights.trackException(err);
}
More information about AppInsights API could be found here
Cordova CLI can be easily installed via NPM package manager: npm install -g cordova
Additional prerequisites for each target platform can be found at Cordova platforms documentation page.
Clone this repository into a directory of your choice
git clone https://github.com/MSOpenTech/cordova-plugin-appinsights.git
Create a cordova project and add the platforms you want to support
cordova create AppInsightsSample --copy-from="cordova-plugin-appinsights/sample"
cd AppInsightsSample
cordova platform add android
cordova platform add windows
cordova platform add ios
Add the plugin to your project
cordova plugin add ../cordova-plugin-appinsights
Set up intrumentation key for AppInsights API. Modify the following line in config.xml
file at the project root
<preference name="instrumentation_key" value="$INSTRUMENTATION_KEY">
replace $INSTRUMENTATION_KEY
with your key.
optional: install battery and network status plugins to track their events to AppInsights as well.
cordova plugin add org.apache.cordova.battery-status org.apache.cordova.network-information
Build and run application: cordova run
.
Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
FAQs
Application Insights Cordova plugin.
The npm package cordova-plugin-ms-appinsights receives a total of 3 weekly downloads. As such, cordova-plugin-ms-appinsights popularity was classified as not popular.
We found that cordova-plugin-ms-appinsights demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.