Skip to content

Commit 6b16e60

Browse files
init
1 parent 824a1d7 commit 6b16e60

File tree

11 files changed

+3233
-4
lines changed

11 files changed

+3233
-4
lines changed

sdk/feature-management-applicationinsights-browser/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ Feature Management Application Insights Plugin for Browser provides a solution f
44

55
## Getting Started
66

7-
### Prerequisites
8-
9-
- Node.js LTS version
10-
117
### Usage
128

139
``` javascript
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es2021": true,
6+
"node": true,
7+
"mocha": true
8+
},
9+
"extends": [
10+
"eslint:recommended",
11+
"plugin:@typescript-eslint/recommended"
12+
],
13+
"ignorePatterns": [
14+
],
15+
"overrides": [
16+
{
17+
"env": {
18+
"node": true
19+
},
20+
"files": [
21+
".eslintrc.{js,cjs}"
22+
],
23+
"parserOptions": {
24+
"sourceType": "script"
25+
}
26+
}
27+
],
28+
"parser": "@typescript-eslint/parser",
29+
"parserOptions": {
30+
"ecmaVersion": "latest"
31+
},
32+
"plugins": [
33+
"@typescript-eslint"
34+
],
35+
"rules": {
36+
"quotes": [
37+
"error",
38+
"double",
39+
{
40+
"avoidEscape": true
41+
}
42+
],
43+
"@typescript-eslint/no-explicit-any": "off",
44+
"eol-last": [
45+
"error",
46+
"always"
47+
],
48+
"no-trailing-spaces": "error",
49+
"space-before-blocks": [
50+
"error",
51+
"always"
52+
],
53+
"no-multi-spaces": "error",
54+
"no-multiple-empty-lines": [
55+
"error",
56+
{
57+
"max": 1
58+
}
59+
],
60+
"semi": ["error", "always"]
61+
}
62+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Microsoft Feature Management Application Insights Plugin for Browser
2+
3+
Feature Management Application Insights Plugin for Browser provides a solution for sending feature flag evaluation events produced by the Feature Management library.
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
9+
- Node.js LTS version
10+
11+
### Usage
12+
13+
``` javascript
14+
import applicationInsights from "applicationinsights";
15+
import { FeatureManager, ConfigurationObjectFeatureFlagProvider } from "@microsoft/feature-management";
16+
import { trackEvent, publishTelemetry } from "@microsoft/feature-management-applicationinsights-node";
17+
18+
applicationInsights.setup(CONNECTION_STRING).start();
19+
20+
const provider = new ConfigurationObjectFeatureFlagProvider(jsonObject);
21+
const featureManager = new FeatureManager(provider, {onFeatureEvaluated: publishTelemetry});
22+
23+
// FeatureEvaluation event will be emitted when a feature flag is evaluated
24+
featureManager.getVariant("TestFeature", {userId : TARGETING_ID}).then((variant) => { /* do something*/ });
25+
26+
// Emit a custom event with targeting id attached.
27+
trackEvent(TARGETING_ID, {name: "TestEvent"});
28+
```
29+
30+
## Contributing
31+
32+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
33+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
34+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
35+
36+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
37+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
38+
provided by the bot. You will only need to do this once across all repos using our CLA.
39+
40+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
41+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
42+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
43+
44+
## Trademarks
45+
46+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
47+
trademarks or logos is subject to and must follow
48+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
49+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
50+
Any use of third-party trademarks or logos are subject to those third-party's policies.

0 commit comments

Comments
 (0)