@featurevisor/sdk 0.36.0 → 0.38.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.38.0](https://github.com/fahad19/featurevisor/compare/v0.37.1...v0.38.0) (2023-07-16)
7
+
8
+
9
+ ### Features
10
+
11
+ * SDK to support isEnabled() checks ([#104](https://github.com/fahad19/featurevisor/issues/104)) ([4f52136](https://github.com/fahad19/featurevisor/commit/4f521367a3f1ef76833ba614b6a1f4b66abef2e1))
12
+
13
+
14
+
15
+
16
+
17
+ # [0.37.0](https://github.com/fahad19/featurevisor/compare/v0.36.0...v0.37.0) (2023-07-14)
18
+
19
+
20
+ ### Features
21
+
22
+ * renamed Attributes (object) to Context ([#101](https://github.com/fahad19/featurevisor/issues/101)) ([c392ad5](https://github.com/fahad19/featurevisor/commit/c392ad5f1b6100167aa5637b131f08036a7f5a55))
23
+
24
+
25
+
26
+
27
+
6
28
  # [0.36.0](https://github.com/fahad19/featurevisor/compare/v0.35.0...v0.36.0) (2023-07-13)
7
29
 
8
30
  **Note:** Version bump only for package @featurevisor/sdk
package/README.md CHANGED
@@ -14,7 +14,7 @@ Visit [https://featurevisor.com/docs/sdks/](https://featurevisor.com/docs/sdks/)
14
14
  - [`datafileUrl`](#datafileurl)
15
15
  - [`handleDatafileFetch`](#handledatafilefetch)
16
16
  - [`initialFeatures`](#initialfeatures)
17
- - [`interceptAttributes`](#interceptattributes)
17
+ - [`interceptContext`](#interceptcontext)
18
18
  - [`logger`](#logger)
19
19
  - [`onActivation`](#onactivation)
20
20
  - [`onReady`](#onready)
@@ -70,7 +70,7 @@ Use it to take over bucketing key generation process.
70
70
 
71
71
  ```js
72
72
  const sdk = createInstance({
73
- configureBucketKey: (feature, attributes, bucketKey) => {
73
+ configureBucketKey: (feature, context, bucketKey) => {
74
74
  return bucketKey;
75
75
  }
76
76
  });
@@ -85,7 +85,7 @@ Use it to take over bucketing process.
85
85
 
86
86
  ```js
87
87
  const sdk = createInstance({
88
- configureBucketValue: (feature, attributes, bucketValue) => {
88
+ configureBucketValue: (feature, context, bucketValue) => {
89
89
  return bucketValue; // 0 to 100,000
90
90
  }
91
91
  });
@@ -143,15 +143,15 @@ const sdk = createInstance({
143
143
  });
144
144
  ```
145
145
 
146
- ### `interceptAttributes`
146
+ ### `interceptContext`
147
147
 
148
148
  - Type: `function`
149
149
  - Required: no
150
150
 
151
- Intercept given attributes before they are used to bucket the user:
151
+ Intercept given context before they are used to bucket the user:
152
152
 
153
153
  ```js
154
- const defaultAttributes = {
154
+ const defaultContext = {
155
155
  platform: "web",
156
156
  locale: "en-US",
157
157
  country: "US",
@@ -160,10 +160,10 @@ const defaultAttributes = {
160
160
  };
161
161
 
162
162
  const sdk = createInstance({
163
- interceptAttributes: (attributes) => {
163
+ interceptContext: (context) => {
164
164
  return {
165
- ...defaultAttributes,
166
- ...attributes,
165
+ ...defaultContext,
166
+ ...context,
167
167
  };
168
168
  }
169
169
  });
@@ -198,13 +198,13 @@ Capture activated features along with their evaluated variation:
198
198
 
199
199
  ```js
200
200
  const sdk = createInstance({
201
- onActivation: (featureKey, variation, attributes, captureAttributes) => {
201
+ onActivation: (featureKey, variation, context, captureContext) => {
202
202
  // do something with the activated feature
203
203
  }
204
204
  });
205
205
  ```
206
206
 
207
- `captureAttributes` will only contain attributes that are marked as `capture: true` in the Attributes' YAML files.
207
+ `captureContext` will only contain attributes that are marked as `capture: true` in the Attributes' YAML files.
208
208
 
209
209
  ### `onReady`
210
210
 
@@ -296,7 +296,7 @@ These methods are available once the SDK instance is created:
296
296
 
297
297
  ### `getVariation`
298
298
 
299
- > `getVariation(featureKey: string, attributes: Attributes): VariationValue`
299
+ > `getVariation(featureKey: string, context: Context): VariationValue`
300
300
 
301
301
  Also supports additional type specific methods:
302
302
 
@@ -307,7 +307,7 @@ Also supports additional type specific methods:
307
307
 
308
308
  ### `getVariable`
309
309
 
310
- > `getVariable(featureKey: string, variableKey: string, attributes: Attributes): VariableValue`
310
+ > `getVariable(featureKey: string, variableKey: string, context: Context): VariableValue`
311
311
 
312
312
  Also supports additional type specific methods:
313
313
 
@@ -321,7 +321,7 @@ Also supports additional type specific methods:
321
321
 
322
322
  ### `activate`
323
323
 
324
- > `activate(featureKey: string, attributes: Attributes): VariationValue`
324
+ > `activate(featureKey: string, context: Context): VariationValue`
325
325
 
326
326
  Same as `getVariation`, but also calls the `onActivation` callback.
327
327