Skip to content

Update readme #102

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 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@

[![feature-management](https://img.shields.io/npm/v/@microsoft/feature-management?label=@microsoft/feature-management)](https://www.npmjs.com/package/@microsoft/feature-management)

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.
Feature management provides a way to develop and expose application functionality based on features. Many applications have special requirements when a new feature is developed such as when the feature should be enabled and under what conditions. This library provides a way to define these relationships, and also integrates into common .NET code patterns to make exposing these features possible.

## Getting Started

### Prerequisites
[Azure App Configuration Quickstart](https://learn.microsoft.com/azure/azure-app-configuration/quickstart-feature-flag-javascript): A quickstart guide about how to integrate feature flags from Azure App Configuration into your JavaScript applications.

- Node.js LTS version
[Feature Overview](https://learn.microsoft.com/azure/azure-app-configuration/feature-management-overview#feature-development-status): This document provides a feature status overview.

[Feature Reference](https://learn.microsoft.com/azure/azure-app-configuration/feature-management-javascript-reference): This document provides a full feature rundown.

### Usage

You can use feature flags from the Azure App Configuration service, local files or any other sources.
You can use feature flags from the Azure App Configuration service, local files or any other sources. For more information, please go to [Feature flag configuration](https://learn.microsoft.com/azure/azure-app-configuration/feature-management-javascript-reference#feature-flag-configuration).

#### Use feature flags from Azure App Configuration

The App Configuration JavaScript provider provides feature flags in as a `Map` object.
A builtin `ConfigurationMapFeatureFlagProvider` helps to load feature flags in this case.

```js
const appConfig = await load(connectionString, {featureFlagOptions}); // load feature flags from Azure App Configuration service
import { load } from "@azure/app-configuration-provider";
import { FeatureManager, ConfigurationMapFeatureFlagProvider } from "@microsoft/feature-management";
const appConfig = await load("<CONNECTION-STRING>", {featureFlagOptions}); // load feature flags from Azure App Configuration service
const featureProvider = new ConfigurationMapFeatureFlagProvider(appConfig);
const featureManager = new FeatureManager(featureProvider);
const isAlphaEnabled = await featureManager.isEnabled("Alpha");
Expand Down Expand Up @@ -54,13 +57,18 @@ Content of `sample.json`:

Load feature flags from `sample.json` file.
```js
import { FeatureManager, ConfigurationObjectFeatureFlagProvider } from "@microsoft/feature-management";
const config = JSON.parse(await fs.readFile("path/to/sample.json"));
const featureProvider = new ConfigurationObjectFeatureFlagProvider(config);
const featureManager = new FeatureManager(featureProvider);
const isAlphaEnabled = await featureManager.isEnabled("Alpha");
console.log("Feature Alpha is:", isAlphaEnabled);
```

## Examples

See code snippets under [examples/](./examples/) folder.

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Expand Down
4 changes: 3 additions & 1 deletion src/feature-management-applicationinsights-browser/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Microsoft Feature Management Application Insights Plugin for Browser

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 Browser provides a solution for sending feature flag evaluation telemetry produced by the [`@microsoft/feature-management`](https://www.npmjs.com/package/@microsoft/feature-management) library.

## Getting Started

For more information, please go to [Feature reference](https://learn.microsoft.com/azure/azure-app-configuration/feature-management-javascript-reference#application-insights-integration).

### Usage

``` javascript
Expand Down
6 changes: 4 additions & 2 deletions src/feature-management-applicationinsights-node/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Microsoft Feature Management Application Insights Plugin for Node

Feature Management Application Insights Plugin for Node 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 telemetry produced by the [`@microsoft/feature-management`](https://www.npmjs.com/package/@microsoft/feature-management) library.

## Getting Started

For more information, please go to [Feature reference](https://learn.microsoft.com/azure/azure-app-configuration/feature-management-javascript-reference#application-insights-integration).

### Prerequisites

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

### Usage

Expand Down
22 changes: 15 additions & 7 deletions src/feature-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@

[![feature-management](https://img.shields.io/npm/v/@microsoft/feature-management?label=@microsoft/feature-management)](https://www.npmjs.com/package/@microsoft/feature-management)

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.
Feature management provides a way to develop and expose application functionality based on features. Many applications have special requirements when a new feature is developed such as when the feature should be enabled and under what conditions. This library provides a way to define these relationships, and also integrates into common .NET code patterns to make exposing these features possible.

## Getting Started

### Prerequisites
[Azure App Configuration Quickstart](https://learn.microsoft.com/azure/azure-app-configuration/quickstart-feature-flag-javascript): A quickstart guide about how to integrate feature flags from Azure App Configuration into your JavaScript applications.

- Node.js LTS version
[Feature Overview](https://learn.microsoft.com/azure/azure-app-configuration/feature-management-overview#feature-development-status): This document provides a feature status overview.

[Feature Reference](https://learn.microsoft.com/azure/azure-app-configuration/feature-management-javascript-reference): This document provides a full feature rundown.

### Usage

You can use feature flags from the Azure App Configuration service, local files or any other sources.
You can use feature flags from the Azure App Configuration service, local files or any other sources. For more information, please go to [Feature flag configuration](https://learn.microsoft.com/azure/azure-app-configuration/feature-management-javascript-reference#feature-flag-configuration).

#### Use feature flags from Azure App Configuration

The App Configuration JavaScript provider provides feature flags in as a `Map` object.
A builtin `ConfigurationMapFeatureFlagProvider` helps to load feature flags in this case.

```js
const appConfig = load(connectionString, {featureFlagOptions}); // load feature flags from Azure App Configuration service
import { load } from "@azure/app-configuration-provider";
import { FeatureManager, ConfigurationMapFeatureFlagProvider } from "@microsoft/feature-management";
const appConfig = await load("<CONNECTION-STRING>", {featureFlagOptions}); // load feature flags from Azure App Configuration service
const featureProvider = new ConfigurationMapFeatureFlagProvider(appConfig);
const featureManager = new FeatureManager(featureProvider);
const isAlphaEnabled = await featureManager.isEnabled("Alpha");
Expand All @@ -42,7 +45,7 @@ Content of `sample.json`:
{
"id": "Alpha",
"description": "",
"enabled": "true",
"enabled": true,
"conditions": {
"client_filters": []
}
Expand All @@ -54,13 +57,18 @@ Content of `sample.json`:

Load feature flags from `sample.json` file.
```js
import { FeatureManager, ConfigurationObjectFeatureFlagProvider } from "@microsoft/feature-management";
const config = JSON.parse(await fs.readFile("path/to/sample.json"));
const featureProvider = new ConfigurationObjectFeatureFlagProvider(config);
const featureManager = new FeatureManager(featureProvider);
const isAlphaEnabled = await featureManager.isEnabled("Alpha");
console.log("Feature Alpha is:", isAlphaEnabled);
```

## Examples

See code snippets under [examples/](./examples/) folder.

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Expand Down
Loading