Skip to content

Merge main to release/v2 #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { FeatureManager, ConfigurationObjectFeatureFlagProvider } from "@microso
import { createTelemetryPublisher, trackEvent } from "@microsoft/feature-management-applicationinsights-browser";

const appInsights = new ApplicationInsights({ config: {
connectionString: CONNECTION_STRING
connectionString: "<APPINSIGHTS_CONNECTION_STRING>"
}});
appInsights.loadAppInsights();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/feature-management-applicationinsights-browser",
"version": "2.0.0",
"version": "2.0.1",
"description": "Feature Management Application Insights Plugin for Browser provides a solution for sending feature flag evaluation events produced by the Feature Management library.",
"main": "./dist/esm/index.js",
"module": "./dist/esm/index.js",
Expand Down Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"@microsoft/applicationinsights-web": "^3.3.2",
"@microsoft/feature-management": "2.0.0"
"@microsoft/feature-management": "2.0.1"
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

export const VERSION = "2.0.0";
export const VERSION = "2.0.1";
18 changes: 9 additions & 9 deletions src/feature-management-applicationinsights-node/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Microsoft Feature Management Application Insights Plugin for Browser
# Microsoft Feature Management Application Insights Plugin for Node

Feature Management Application Insights Plugin for Browser provides a solution for sending feature flag evaluation events produced by the Feature Management library.
Feature Management Application Insights Plugin for Node provides a solution for sending feature flag evaluation events produced by the Feature Management library.

## Getting Started

### Prerequisites

- Node.js LTS version
- `applicationinsights` SDK v2(classic)

### Usage

``` javascript
import appInsights from "applicationinsights";
import { FeatureManager, ConfigurationObjectFeatureFlagProvider } from "@microsoft/feature-management";
import { createTelemetryPublisher, trackEvent } from "@microsoft/feature-management-applicationinsights-node";
const appInsights = require("applicationinsights");
appInsights.setup(process.env.APPINSIGHTS_CONNECTION_STRING).start();

appInsights.setup(CONNECTION_STRING)
.start();
const { FeatureManager, ConfigurationObjectFeatureFlagProvider } = require("@microsoft/feature-management");
const { createTelemetryPublisher, trackEvent } = require("@microsoft/feature-management-applicationinsights-node");

const publishTelemetry = createTelemetryPublisher(appInsights.defaultClient);
const provider = new ConfigurationObjectFeatureFlagProvider(jsonObject);
const featureManager = new FeatureManager(provider, {onFeatureEvaluated: publishTelemetry});

// FeatureEvaluation event will be emitted when a feature flag is evaluated
featureManager.getVariant("TestFeature", {userId : TARGETING_ID}).then((variant) => { /* do something*/ });
featureManager.getVariant("TestFeature", {userId : "<TARGETING_ID>"}).then((variant) => { /* do something*/ });

// Emit a custom event with targeting id attached.
trackEvent(appInsights.defaultClient, TARGETING_ID, {name: "TestEvent"});
trackEvent(appInsights.defaultClient, "<TARGETING_ID>", {name: "TestEvent", properties: {"Tag": "Some Value"}});
```

## Contributing
Expand Down
4 changes: 2 additions & 2 deletions src/feature-management-applicationinsights-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/feature-management-applicationinsights-node",
"version": "2.0.0",
"version": "2.0.1",
"description": "Feature Management Application Insights Plugin for Node.js provides a solution for sending feature flag evaluation events produced by the Feature Management library.",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
Expand Down Expand Up @@ -45,7 +45,7 @@
},
"dependencies": {
"applicationinsights": "^2.9.6",
"@microsoft/feature-management": "2.0.0"
"@microsoft/feature-management": "2.0.1"
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

export const VERSION = "2.0.0";
export const VERSION = "2.0.1";
4 changes: 2 additions & 2 deletions src/feature-management/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/feature-management/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/feature-management",
"version": "2.0.0",
"version": "2.0.1",
"description": "Feature Management is a library for enabling/disabling features at runtime. Developers can use feature flags in simple use cases like conditional statement to more advanced scenarios like conditionally adding routes.",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/feature-management/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

export const VERSION = "2.0.0";
export const VERSION = "2.0.1";
export const EVALUATION_EVENT_VERSION = "1.0.0";