@microsoft/feature-management-applicationinsights-node 2.0.0-preview.3 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,32 +1,34 @@
1
- # Microsoft Feature Management Application Insights Plugin for Browser
1
+ # Microsoft Feature Management Application Insights Plugin for Node
2
2
 
3
- Feature Management Application Insights Plugin for Browser provides a solution for sending feature flag evaluation events produced by the Feature Management library.
3
+ Feature Management Application Insights Plugin for Node provides a solution for sending feature flag evaluation telemetry produced by the [`@microsoft/feature-management`](https://www.npmjs.com/package/@microsoft/feature-management) library.
4
4
 
5
5
  ## Getting Started
6
6
 
7
+ For more information, please go to [Feature reference](https://learn.microsoft.com/azure/azure-app-configuration/feature-management-javascript-reference#application-insights-integration).
8
+
7
9
  ### Prerequisites
8
10
 
9
11
  - Node.js LTS version
12
+ - `applicationinsights` SDK 2.x (classic)
10
13
 
11
14
  ### Usage
12
15
 
13
16
  ``` javascript
14
- import appInsights from "applicationinsights";
15
- import { FeatureManager, ConfigurationObjectFeatureFlagProvider } from "@microsoft/feature-management";
16
- import { trackEvent, publishTelemetry } from "@microsoft/feature-management-applicationinsights-node";
17
+ const appInsights = require("applicationinsights");
18
+ appInsights.setup(process.env.APPINSIGHTS_CONNECTION_STRING).start();
17
19
 
18
- appInsights.setup(CONNECTION_STRING)
19
- .start();
20
+ const { FeatureManager, ConfigurationObjectFeatureFlagProvider } = require("@microsoft/feature-management");
21
+ const { createTelemetryPublisher, trackEvent } = require("@microsoft/feature-management-applicationinsights-node");
20
22
 
21
23
  const publishTelemetry = createTelemetryPublisher(appInsights.defaultClient);
22
24
  const provider = new ConfigurationObjectFeatureFlagProvider(jsonObject);
23
25
  const featureManager = new FeatureManager(provider, {onFeatureEvaluated: publishTelemetry});
24
26
 
25
27
  // FeatureEvaluation event will be emitted when a feature flag is evaluated
26
- featureManager.getVariant("TestFeature", {userId : TARGETING_ID}).then((variant) => { /* do something*/ });
28
+ featureManager.getVariant("TestFeature", {userId : "<TARGETING_ID>"}).then((variant) => { /* do something*/ });
27
29
 
28
30
  // Emit a custom event with targeting id attached.
29
- trackEvent(appInsights.defaultClient, TARGETING_ID, {name: "TestEvent"});
31
+ trackEvent(appInsights.defaultClient, "<TARGETING_ID>", {name: "TestEvent", properties: {"Tag": "Some Value"}});
30
32
  ```
31
33
 
32
34
  ## Contributing
@@ -2,7 +2,7 @@
2
2
 
3
3
  // Copyright (c) Microsoft Corporation.
4
4
  // Licensed under the MIT license.
5
- const VERSION = "2.0.0-preview.3";
5
+ const VERSION = "2.0.1";
6
6
 
7
7
  exports.VERSION = VERSION;
8
8
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const VERSION = \"2.0.0-preview.3\";\n"],"names":[],"mappings":";;AAAA;AACA;AAEO,MAAM,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const VERSION = \"2.0.1\";\n"],"names":[],"mappings":";;AAAA;AACA;AAEO,MAAM,OAAO,GAAG;;;;"}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- const VERSION = "2.0.0-preview.3";
3
+ const VERSION = "2.0.1";
4
4
 
5
5
  export { VERSION };
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const VERSION = \"2.0.0-preview.3\";\n"],"names":[],"mappings":"AAAA;AACA;AAEO,MAAM,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const VERSION = \"2.0.1\";\n"],"names":[],"mappings":"AAAA;AACA;AAEO,MAAM,OAAO,GAAG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/feature-management-applicationinsights-node",
3
- "version": "2.0.0-preview.3",
3
+ "version": "2.0.1",
4
4
  "description": "Feature Management Application Insights Plugin for Node.js provides a solution for sending feature flag evaluation events produced by the Feature Management library.",
5
5
  "main": "./dist/commonjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -24,6 +24,9 @@
24
24
  "url": "git+https://github.com/microsoft/FeatureManagement-JavaScript.git"
25
25
  },
26
26
  "license": "MIT",
27
+ "publishConfig": {
28
+ "tag": "latest"
29
+ },
27
30
  "bugs": {
28
31
  "url": "https://github.com/microsoft/FeatureManagement-JavaScript/issues"
29
32
  },
@@ -42,7 +45,7 @@
42
45
  },
43
46
  "dependencies": {
44
47
  "applicationinsights": "^2.9.6",
45
- "@microsoft/feature-management": "2.0.0-preview.3"
48
+ "@microsoft/feature-management": "2.0.1"
46
49
  }
47
50
  }
48
51
 
package/types/index.d.ts CHANGED
@@ -18,6 +18,6 @@ declare function createTelemetryPublisher(client: TelemetryClient): (result: Eva
18
18
  */
19
19
  declare function trackEvent(client: TelemetryClient, targetingId: string, event: Contracts.EventTelemetry): void;
20
20
 
21
- declare const VERSION = "2.0.0-preview.3";
21
+ declare const VERSION = "2.0.1";
22
22
 
23
23
  export { VERSION, createTelemetryPublisher, trackEvent };