@splitsoftware/openfeature-js-split-provider 1.0.3 → 1.0.5

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/CHANGES.txt CHANGED
@@ -8,4 +8,7 @@
8
8
  - Up to date with spec 0.4.0 and @openfeature/js-sdk 0.4.0
9
9
  1.0.3
10
10
  - Adds types definitions for TypeScript
11
- - Up to date with spec 0.4.0 and @openfeature/js-sdk 0.4.0
11
+ - Up to date with spec 0.4.0 and @openfeature/js-sdk 0.4.0
12
+ 1.0.4
13
+ - Fixes issue with TS build
14
+ - Up to date with spec 0.5.0 and @openfeature/js-sdk 0.5.0
package/README.md CHANGED
@@ -10,13 +10,27 @@ This Provider is designed to allow the use of OpenFeature with Split, the platfo
10
10
  ## Getting started
11
11
  Below is a simple example that describes the instantiation of the Split Provider. Please see the [OpenFeature Documentation](https://docs.openfeature.dev/docs/reference/concepts/evaluation-api) for details on how to use the OpenFeature SDK.
12
12
 
13
+ ### Add the Split provider
14
+
15
+ ```sh
16
+ npm install @splitsoftware/openfeature-js-split-provider
17
+ ```
18
+
19
+ ### Confirm peer dependencies are installed
20
+ ```sh
21
+ npm install @splitsoftware/splitio
22
+ npm install @openfeature/js-sdk
23
+ ```
24
+
25
+ ### Register the Split provider with OpenFeature
13
26
  ```js
14
27
  const OpenFeature = require('@openfeature/js-sdk').OpenFeature;
15
28
  const SplitFactory = require('@splitsoftware/splitio').SplitFactory;
16
29
  const OpenFeatureSplitProvider = require('@splitsoftware/openfeature-js-split-provider').OpenFeatureSplitProvider;
17
30
 
18
- splitClient = SplitFactory({core: {authorizationKey: 'localhost'}}).client();
19
- provider = new OpenFeatureSplitProvider({splitClient});
31
+ const authorizationKey = 'your auth key'
32
+ const splitClient = SplitFactory({core: {authorizationKey}}).client();
33
+ const provider = new OpenFeatureSplitProvider({splitClient});
20
34
  openFeature.setProvider(provider);
21
35
  ```
22
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/openfeature-js-split-provider",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Split OpenFeature Provider",
5
5
  "files": [
6
6
  "README.md",
@@ -17,8 +17,6 @@
17
17
  "bugs": "https://github.com/splitio/openfeature-split-provider-js/issues",
18
18
  "license": "Apache-2.0",
19
19
  "author": "Josh Sirota <josh.sirota@split.io>",
20
- "contributors": [
21
- ],
22
20
  "main": "lib/index.js",
23
21
  "module": "es/index.js",
24
22
  "types": "types",
@@ -26,11 +24,14 @@
26
24
  "npm": ">=3",
27
25
  "node": ">=6"
28
26
  },
29
- "dependencies": {
30
- "@openfeature/js-sdk": "^0.4.0",
31
- "@splitsoftware/splitio": "^10.21.1"
27
+ "dependencies": {},
28
+ "peerDependencies": {
29
+ "@openfeature/js-sdk": "^1.0.0",
30
+ "@splitsoftware/splitio": "^10.22.1"
32
31
  },
33
32
  "devDependencies": {
33
+ "@openfeature/js-sdk": "^1.0.0",
34
+ "@splitsoftware/splitio": "^10.22.1",
34
35
  "copyfiles": "^2.4.1",
35
36
  "cross-env": "^7.0.3",
36
37
  "replace": "^1.2.1",
@@ -37,8 +37,8 @@ export default async function(assert) {
37
37
  const getControlVariantNonExistentSplit = async (client) => {
38
38
  let details = await client.getBooleanDetails('non-existent-feature', false);
39
39
  assert.equals(details.value, false);
40
- assert.equals(details.variant, 'control');
41
- assert.equals(details.reason, 'FLAG_NOT_FOUND');
40
+ assert.equals(details.errorCode, 'FLAG_NOT_FOUND');
41
+ assert.equals(details.reason, 'ERROR');
42
42
  };
43
43
 
44
44
  const getBooleanSplitTest = async (client) => {
@@ -1,5 +1,14 @@
1
- import { EvaluationContext, Provider, ResolutionDetails, ParseError, FlagNotFoundError, JsonValue, OpenFeatureError, StandardResolutionReasons } from '@openfeature/js-sdk';
2
- import SplitIO from '@splitsoftware/splitio/types/splitio';
1
+ import {
2
+ EvaluationContext,
3
+ Provider,
4
+ ResolutionDetails,
5
+ ParseError,
6
+ FlagNotFoundError,
7
+ JsonValue,
8
+ TargetingKeyMissingError,
9
+ StandardResolutionReasons,
10
+ } from "@openfeature/js-sdk";
11
+ import type SplitIO from "@splitsoftware/splitio/types/splitio";
3
12
 
4
13
  export interface SplitProviderOptions {
5
14
  splitClient: SplitIO.IClient;
@@ -10,9 +19,11 @@ type Consumer = {
10
19
  attributes: SplitIO.Attributes;
11
20
  };
12
21
 
22
+ const CONTROL_VALUE_ERROR_MESSAGE = "Received the 'control' value from Split.";
23
+
13
24
  export class OpenFeatureSplitProvider implements Provider {
14
25
  metadata = {
15
- name: 'split',
26
+ name: "split",
16
27
  };
17
28
  private initialized: Promise<void>;
18
29
  private client: SplitIO.IClient;
@@ -29,23 +40,26 @@ export class OpenFeatureSplitProvider implements Provider {
29
40
 
30
41
  async resolveBooleanEvaluation(
31
42
  flagKey: string,
32
- defaultValue: boolean,
43
+ _: boolean,
33
44
  context: EvaluationContext
34
45
  ): Promise<ResolutionDetails<boolean>> {
35
- const details = await this.evaluateTreatment(flagKey, this.transformContext(context));
46
+ const details = await this.evaluateTreatment(
47
+ flagKey,
48
+ this.transformContext(context)
49
+ );
36
50
 
37
51
  let value: boolean;
38
52
  switch (details.value as unknown) {
39
- case 'on':
53
+ case "on":
40
54
  value = true;
41
55
  break;
42
- case 'off':
56
+ case "off":
43
57
  value = false;
44
58
  break;
45
- case 'true':
59
+ case "true":
46
60
  value = true;
47
61
  break;
48
- case 'false':
62
+ case "false":
49
63
  value = false;
50
64
  break;
51
65
  case true:
@@ -54,10 +68,8 @@ export class OpenFeatureSplitProvider implements Provider {
54
68
  case false:
55
69
  value = false;
56
70
  break;
57
- case 'control':
58
- value = defaultValue;
59
- details.reason = 'FLAG_NOT_FOUND';
60
- break;
71
+ case "control":
72
+ throw new FlagNotFoundError(CONTROL_VALUE_ERROR_MESSAGE);
61
73
  default:
62
74
  throw new ParseError(`Invalid boolean value for ${details.value}`);
63
75
  }
@@ -69,9 +81,12 @@ export class OpenFeatureSplitProvider implements Provider {
69
81
  _: string,
70
82
  context: EvaluationContext
71
83
  ): Promise<ResolutionDetails<string>> {
72
- const details = await this.evaluateTreatment(flagKey, this.transformContext(context));
73
- if (details.value == 'control') {
74
- throw new FlagNotFoundError(`Got error for split ${flagKey}`);
84
+ const details = await this.evaluateTreatment(
85
+ flagKey,
86
+ this.transformContext(context)
87
+ );
88
+ if (details.value === "control") {
89
+ throw new FlagNotFoundError(CONTROL_VALUE_ERROR_MESSAGE);
75
90
  }
76
91
  return details;
77
92
  }
@@ -81,7 +96,10 @@ export class OpenFeatureSplitProvider implements Provider {
81
96
  _: number,
82
97
  context: EvaluationContext
83
98
  ): Promise<ResolutionDetails<number>> {
84
- const details = await this.evaluateTreatment(flagKey, this.transformContext(context));
99
+ const details = await this.evaluateTreatment(
100
+ flagKey,
101
+ this.transformContext(context)
102
+ );
85
103
  return { ...details, value: this.parseValidNumber(details.value) };
86
104
  }
87
105
 
@@ -90,26 +108,32 @@ export class OpenFeatureSplitProvider implements Provider {
90
108
  _: U,
91
109
  context: EvaluationContext
92
110
  ): Promise<ResolutionDetails<U>> {
93
- const details = await this.evaluateTreatment(flagKey, this.transformContext(context));
111
+ const details = await this.evaluateTreatment(
112
+ flagKey,
113
+ this.transformContext(context)
114
+ );
94
115
  return { ...details, value: this.parseValidJsonObject(details.value) };
95
116
  }
96
117
 
97
- private async evaluateTreatment(flagKey: string, consumer: Consumer): Promise<ResolutionDetails<string>> {
118
+ private async evaluateTreatment(
119
+ flagKey: string,
120
+ consumer: Consumer
121
+ ): Promise<ResolutionDetails<string>> {
98
122
  if (!consumer.key) {
99
- const details: ResolutionDetails<string> = {
100
- value: 'control',
101
- variant: 'control',
102
- reason: StandardResolutionReasons.ERROR,
103
- errorCode: 'TARGETING_KEY_MISSING'
104
- }
105
- return details;
123
+ throw new TargetingKeyMissingError(
124
+ "The Split provider requires a targeting key."
125
+ );
106
126
  } else {
107
127
  await this.initialized;
108
- const value = this.client.getTreatment(consumer.key, flagKey, consumer.attributes);
128
+ const value = this.client.getTreatment(
129
+ consumer.key,
130
+ flagKey,
131
+ consumer.attributes
132
+ );
109
133
  const details: ResolutionDetails<string> = {
110
134
  value: value,
111
135
  variant: value,
112
- reason: StandardResolutionReasons.TARGETING_MATCH
136
+ reason: StandardResolutionReasons.TARGETING_MATCH,
113
137
  };
114
138
  return details;
115
139
  }
@@ -136,14 +160,16 @@ export class OpenFeatureSplitProvider implements Provider {
136
160
  return result;
137
161
  }
138
162
 
139
- private parseValidJsonObject<T extends JsonValue>(stringValue: string | undefined): T {
163
+ private parseValidJsonObject<T extends JsonValue>(
164
+ stringValue: string | undefined
165
+ ): T {
140
166
  if (stringValue === undefined) {
141
167
  throw new ParseError(`Invalid 'undefined' JSON value.`);
142
168
  }
143
169
  // we may want to allow the parsing to be customized.
144
170
  try {
145
171
  const value = JSON.parse(stringValue);
146
- if (typeof value !== 'object') {
172
+ if (typeof value !== "object") {
147
173
  throw new ParseError(
148
174
  `Flag value ${stringValue} had unexpected type ${typeof value}, expected "object"`
149
175
  );
package/es/index.js DELETED
@@ -1 +0,0 @@
1
- export * from './lib/js-split-provider';
@@ -1,163 +0,0 @@
1
- import { __assign, __awaiter, __generator, __rest } from "tslib";
2
- import { ParseError, FlagNotFoundError, StandardResolutionReasons } from '@openfeature/js-sdk';
3
- var OpenFeatureSplitProvider = /** @class */ (function () {
4
- function OpenFeatureSplitProvider(options) {
5
- var _this = this;
6
- this.metadata = {
7
- name: 'split',
8
- };
9
- this.client = options.splitClient;
10
- this.initialized = new Promise(function (resolve) {
11
- _this.client.on(_this.client.Event.SDK_READY, function () {
12
- console.log(_this.metadata.name + " provider initialized");
13
- resolve();
14
- });
15
- });
16
- }
17
- OpenFeatureSplitProvider.prototype.resolveBooleanEvaluation = function (flagKey, defaultValue, context) {
18
- return __awaiter(this, void 0, void 0, function () {
19
- var details, value;
20
- return __generator(this, function (_a) {
21
- switch (_a.label) {
22
- case 0: return [4 /*yield*/, this.evaluateTreatment(flagKey, this.transformContext(context))];
23
- case 1:
24
- details = _a.sent();
25
- switch (details.value) {
26
- case 'on':
27
- value = true;
28
- break;
29
- case 'off':
30
- value = false;
31
- break;
32
- case 'true':
33
- value = true;
34
- break;
35
- case 'false':
36
- value = false;
37
- break;
38
- case true:
39
- value = true;
40
- break;
41
- case false:
42
- value = false;
43
- break;
44
- case 'control':
45
- value = defaultValue;
46
- details.reason = 'FLAG_NOT_FOUND';
47
- break;
48
- default:
49
- throw new ParseError("Invalid boolean value for " + details.value);
50
- }
51
- return [2 /*return*/, __assign(__assign({}, details), { value: value })];
52
- }
53
- });
54
- });
55
- };
56
- OpenFeatureSplitProvider.prototype.resolveStringEvaluation = function (flagKey, _, context) {
57
- return __awaiter(this, void 0, void 0, function () {
58
- var details;
59
- return __generator(this, function (_a) {
60
- switch (_a.label) {
61
- case 0: return [4 /*yield*/, this.evaluateTreatment(flagKey, this.transformContext(context))];
62
- case 1:
63
- details = _a.sent();
64
- if (details.value == 'control') {
65
- throw new FlagNotFoundError("Got error for split " + flagKey);
66
- }
67
- return [2 /*return*/, details];
68
- }
69
- });
70
- });
71
- };
72
- OpenFeatureSplitProvider.prototype.resolveNumberEvaluation = function (flagKey, _, context) {
73
- return __awaiter(this, void 0, void 0, function () {
74
- var details;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0: return [4 /*yield*/, this.evaluateTreatment(flagKey, this.transformContext(context))];
78
- case 1:
79
- details = _a.sent();
80
- return [2 /*return*/, __assign(__assign({}, details), { value: this.parseValidNumber(details.value) })];
81
- }
82
- });
83
- });
84
- };
85
- OpenFeatureSplitProvider.prototype.resolveObjectEvaluation = function (flagKey, _, context) {
86
- return __awaiter(this, void 0, void 0, function () {
87
- var details;
88
- return __generator(this, function (_a) {
89
- switch (_a.label) {
90
- case 0: return [4 /*yield*/, this.evaluateTreatment(flagKey, this.transformContext(context))];
91
- case 1:
92
- details = _a.sent();
93
- return [2 /*return*/, __assign(__assign({}, details), { value: this.parseValidJsonObject(details.value) })];
94
- }
95
- });
96
- });
97
- };
98
- OpenFeatureSplitProvider.prototype.evaluateTreatment = function (flagKey, consumer) {
99
- return __awaiter(this, void 0, void 0, function () {
100
- var details, value, details;
101
- return __generator(this, function (_a) {
102
- switch (_a.label) {
103
- case 0:
104
- if (!!consumer.key) return [3 /*break*/, 1];
105
- details = {
106
- value: 'control',
107
- variant: 'control',
108
- reason: StandardResolutionReasons.ERROR,
109
- errorCode: 'TARGETING_KEY_MISSING'
110
- };
111
- return [2 /*return*/, details];
112
- case 1: return [4 /*yield*/, this.initialized];
113
- case 2:
114
- _a.sent();
115
- value = this.client.getTreatment(consumer.key, flagKey, consumer.attributes);
116
- details = {
117
- value: value,
118
- variant: value,
119
- reason: StandardResolutionReasons.TARGETING_MATCH
120
- };
121
- return [2 /*return*/, details];
122
- }
123
- });
124
- });
125
- };
126
- //Transform the context into an object useful for the Split API, an key string with arbitrary Split "Attributes".
127
- OpenFeatureSplitProvider.prototype.transformContext = function (context) {
128
- var targetingKey = context.targetingKey, attributes = __rest(context, ["targetingKey"]);
129
- return {
130
- key: targetingKey,
131
- // Stringify context objects include date.
132
- attributes: JSON.parse(JSON.stringify(attributes)),
133
- };
134
- };
135
- OpenFeatureSplitProvider.prototype.parseValidNumber = function (stringValue) {
136
- if (stringValue === undefined) {
137
- throw new ParseError("Invalid 'undefined' value.");
138
- }
139
- var result = Number.parseFloat(stringValue);
140
- if (Number.isNaN(result)) {
141
- throw new ParseError("Invalid numeric value " + stringValue);
142
- }
143
- return result;
144
- };
145
- OpenFeatureSplitProvider.prototype.parseValidJsonObject = function (stringValue) {
146
- if (stringValue === undefined) {
147
- throw new ParseError("Invalid 'undefined' JSON value.");
148
- }
149
- // we may want to allow the parsing to be customized.
150
- try {
151
- var value = JSON.parse(stringValue);
152
- if (typeof value !== 'object') {
153
- throw new ParseError("Flag value " + stringValue + " had unexpected type " + typeof value + ", expected \"object\"");
154
- }
155
- return value;
156
- }
157
- catch (err) {
158
- throw new ParseError("Error parsing " + stringValue + " as JSON, " + err);
159
- }
160
- };
161
- return OpenFeatureSplitProvider;
162
- }());
163
- export { OpenFeatureSplitProvider };
package/lib/index.js DELETED
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./lib/js-split-provider"), exports);
@@ -1,166 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpenFeatureSplitProvider = void 0;
4
- var tslib_1 = require("tslib");
5
- var js_sdk_1 = require("@openfeature/js-sdk");
6
- var OpenFeatureSplitProvider = /** @class */ (function () {
7
- function OpenFeatureSplitProvider(options) {
8
- var _this = this;
9
- this.metadata = {
10
- name: 'split',
11
- };
12
- this.client = options.splitClient;
13
- this.initialized = new Promise(function (resolve) {
14
- _this.client.on(_this.client.Event.SDK_READY, function () {
15
- console.log(_this.metadata.name + " provider initialized");
16
- resolve();
17
- });
18
- });
19
- }
20
- OpenFeatureSplitProvider.prototype.resolveBooleanEvaluation = function (flagKey, defaultValue, context) {
21
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
22
- var details, value;
23
- return (0, tslib_1.__generator)(this, function (_a) {
24
- switch (_a.label) {
25
- case 0: return [4 /*yield*/, this.evaluateTreatment(flagKey, this.transformContext(context))];
26
- case 1:
27
- details = _a.sent();
28
- switch (details.value) {
29
- case 'on':
30
- value = true;
31
- break;
32
- case 'off':
33
- value = false;
34
- break;
35
- case 'true':
36
- value = true;
37
- break;
38
- case 'false':
39
- value = false;
40
- break;
41
- case true:
42
- value = true;
43
- break;
44
- case false:
45
- value = false;
46
- break;
47
- case 'control':
48
- value = defaultValue;
49
- details.reason = 'FLAG_NOT_FOUND';
50
- break;
51
- default:
52
- throw new js_sdk_1.ParseError("Invalid boolean value for " + details.value);
53
- }
54
- return [2 /*return*/, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, details), { value: value })];
55
- }
56
- });
57
- });
58
- };
59
- OpenFeatureSplitProvider.prototype.resolveStringEvaluation = function (flagKey, _, context) {
60
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
61
- var details;
62
- return (0, tslib_1.__generator)(this, function (_a) {
63
- switch (_a.label) {
64
- case 0: return [4 /*yield*/, this.evaluateTreatment(flagKey, this.transformContext(context))];
65
- case 1:
66
- details = _a.sent();
67
- if (details.value == 'control') {
68
- throw new js_sdk_1.FlagNotFoundError("Got error for split " + flagKey);
69
- }
70
- return [2 /*return*/, details];
71
- }
72
- });
73
- });
74
- };
75
- OpenFeatureSplitProvider.prototype.resolveNumberEvaluation = function (flagKey, _, context) {
76
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
77
- var details;
78
- return (0, tslib_1.__generator)(this, function (_a) {
79
- switch (_a.label) {
80
- case 0: return [4 /*yield*/, this.evaluateTreatment(flagKey, this.transformContext(context))];
81
- case 1:
82
- details = _a.sent();
83
- return [2 /*return*/, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, details), { value: this.parseValidNumber(details.value) })];
84
- }
85
- });
86
- });
87
- };
88
- OpenFeatureSplitProvider.prototype.resolveObjectEvaluation = function (flagKey, _, context) {
89
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
90
- var details;
91
- return (0, tslib_1.__generator)(this, function (_a) {
92
- switch (_a.label) {
93
- case 0: return [4 /*yield*/, this.evaluateTreatment(flagKey, this.transformContext(context))];
94
- case 1:
95
- details = _a.sent();
96
- return [2 /*return*/, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, details), { value: this.parseValidJsonObject(details.value) })];
97
- }
98
- });
99
- });
100
- };
101
- OpenFeatureSplitProvider.prototype.evaluateTreatment = function (flagKey, consumer) {
102
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
103
- var details, value, details;
104
- return (0, tslib_1.__generator)(this, function (_a) {
105
- switch (_a.label) {
106
- case 0:
107
- if (!!consumer.key) return [3 /*break*/, 1];
108
- details = {
109
- value: 'control',
110
- variant: 'control',
111
- reason: js_sdk_1.StandardResolutionReasons.ERROR,
112
- errorCode: 'TARGETING_KEY_MISSING'
113
- };
114
- return [2 /*return*/, details];
115
- case 1: return [4 /*yield*/, this.initialized];
116
- case 2:
117
- _a.sent();
118
- value = this.client.getTreatment(consumer.key, flagKey, consumer.attributes);
119
- details = {
120
- value: value,
121
- variant: value,
122
- reason: js_sdk_1.StandardResolutionReasons.TARGETING_MATCH
123
- };
124
- return [2 /*return*/, details];
125
- }
126
- });
127
- });
128
- };
129
- //Transform the context into an object useful for the Split API, an key string with arbitrary Split "Attributes".
130
- OpenFeatureSplitProvider.prototype.transformContext = function (context) {
131
- var targetingKey = context.targetingKey, attributes = (0, tslib_1.__rest)(context, ["targetingKey"]);
132
- return {
133
- key: targetingKey,
134
- // Stringify context objects include date.
135
- attributes: JSON.parse(JSON.stringify(attributes)),
136
- };
137
- };
138
- OpenFeatureSplitProvider.prototype.parseValidNumber = function (stringValue) {
139
- if (stringValue === undefined) {
140
- throw new js_sdk_1.ParseError("Invalid 'undefined' value.");
141
- }
142
- var result = Number.parseFloat(stringValue);
143
- if (Number.isNaN(result)) {
144
- throw new js_sdk_1.ParseError("Invalid numeric value " + stringValue);
145
- }
146
- return result;
147
- };
148
- OpenFeatureSplitProvider.prototype.parseValidJsonObject = function (stringValue) {
149
- if (stringValue === undefined) {
150
- throw new js_sdk_1.ParseError("Invalid 'undefined' JSON value.");
151
- }
152
- // we may want to allow the parsing to be customized.
153
- try {
154
- var value = JSON.parse(stringValue);
155
- if (typeof value !== 'object') {
156
- throw new js_sdk_1.ParseError("Flag value " + stringValue + " had unexpected type " + typeof value + ", expected \"object\"");
157
- }
158
- return value;
159
- }
160
- catch (err) {
161
- throw new js_sdk_1.ParseError("Error parsing " + stringValue + " as JSON, " + err);
162
- }
163
- };
164
- return OpenFeatureSplitProvider;
165
- }());
166
- exports.OpenFeatureSplitProvider = OpenFeatureSplitProvider;
package/types/index.d.ts DELETED
@@ -1,17 +0,0 @@
1
- // Declaration file for Javascript and Node OpenFeature Split Provider
2
- // Project: http://www.split.io/
3
-
4
- import { Provider } from "@openfeature/js-sdk";
5
-
6
- export = SplitProvider;
7
-
8
- declare module SplitProvider {
9
- export interface SplitProviderOptions {
10
- splitClient: SplitIO.IClient;
11
- }
12
-
13
- /**
14
- * OpenFeature Split Provider constructor.
15
- */
16
- export function OpenFeatureSplitProvider(options: SplitProviderOptions): Provider;
17
- }