ApplicationInsights-JS/tools/applicationinsights-web-sni...
Karlie-777 3ab2b040fe
[Main] [Release] Increase version to 3.3.1 (#2392)
* release 3.3.1

* update
2024-08-07 12:31:23 -07:00
..
Tests [main] create snippet mini loader (#2339) 2024-06-17 14:14:14 -07:00
src Update type.ts (#2374) 2024-07-09 16:47:43 -07:00
.npmignore [Main] Add npm-pack and npm-publish tasks (#2033) 2023-04-06 13:57:43 -07:00
LICENSE Merge master to beta @ 200e0f1d5d (#1867) 2022-07-28 07:53:29 -07:00
NOTICE Merge master to beta @ 200e0f1d5d (#1867) 2022-07-28 07:53:29 -07:00
PRIVACY Merge master to beta @ 200e0f1d5d (#1867) 2022-07-28 07:53:29 -07:00
README.md [main][snippet] prepare new snippet release, add support for more config (#2365) 2024-06-21 14:29:40 -07:00
api-extractor.json [main] [BUG] @microsoft/applicationinsights-web-snippet version 1.1.1 type problem #2284 (#2286) 2024-03-01 16:58:28 -08:00
package.json [Main] [Release] Increase version to 3.3.1 (#2392) 2024-08-07 12:31:23 -07:00
rollup.config.js [Main] Add npm-pack and npm-publish tasks (#2033) 2023-04-06 13:57:43 -07:00
rollupSnippet.config.js [Main] Bug New minified bundles are corrupting global scope (#2157) 2023-09-18 17:35:10 -07:00
tsconfig.json [main] generate typedoc (#2188) 2023-10-30 14:39:02 -07:00
tslint.json add web snippet npm package (#1802) 2022-05-10 10:58:32 -07:00
typedoc.json [main] implement Osplugin, extracting windows 11 info and put into telemetry (#2294) 2024-04-03 01:40:22 -07:00

README.md

Microsoft Application Insights JavaScript SDK - Web Snippet

GitHub Workflow Status (main) Build Status npm version

Web Snippet for the Application Insights Javascript SDK

This project exists to publish latest Application Insights Javascript Web Snippet.

Basic Usage

Add the Application Insights Web Snippet to your app's dependencies and package.json.

npm i @microsoft/applicationinsights-web-snippet

Pass in Key via Function (available since v1.1.0)

Import the helper function from the package to easily get the snippet

import { getSdkLoaderScript } from "@microsoft/applicationinsights-web-snippet";

Configure the snippet with your connectionString or other customerized field:

let config = {connectionString: "InstrumentationKey=xxx", name: "myAppInsights"}; 
// or let config = {instrumentationKey: key, sri: true};
let theSnippet = getSdkLoaderScript(config);

Multiple Snippet Run Simutinously (available since v1.2.0)

Configure two snippets with different name.

let firstConfig = {connectionString: "InstrumentationKey=xxx", name: "firstAppInsights"}; 
let firstSnippet = getSdkLoaderScript(firstConfig);
let secondConfig = {connectionString: "InstrumentationKey=xxx", name: "secondAppInsights"}; 
let secondSnippet = getSdkLoaderScript(secondConfig);

Snippet Run With Integrity Check and Minified Loading Time (available since v1.2.0)

Configure the snippet with sri enabled.

let config = {connectionString: "InstrumentationKey=xxx", sri: true};

More details on web snippet, see Web Snippet.

Build

npm install -g grunt-cli
npm install
npm run build --silent

Contributing

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.

Data Collection

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 Microsofts 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.

Trademarks

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 Microsofts 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-partys policies.

License

MIT