Skip to content

Commit 0d03ee8

Browse files
Add apiKey instantiation to readme
1 parent 516b220 commit 0d03ee8

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ npm install @splitsoftware/splitio
2323
npm install @openfeature/server-sdk
2424
```
2525

26-
### Register the Split provider with OpenFeature using splitClient
26+
### Register the Split provider with OpenFeature using sdk apiKey
2727
```js
2828
const OpenFeature = require('@openfeature/server-sdk').OpenFeature;
29-
const SplitFactory = require('@splitsoftware/splitio').SplitFactory;
3029
const OpenFeatureSplitProvider = require('@splitsoftware/openfeature-js-split-provider').OpenFeatureSplitProvider;
3130

3231
const authorizationKey = 'your auth key'
33-
const splitClient = SplitFactory({core: {authorizationKey}}).client();
34-
const provider = new OpenFeatureSplitProvider({splitClient});
32+
const provider = new OpenFeatureSplitProvider(authorizationKey);
3533
OpenFeature.setProvider(provider);
3634
```
3735

@@ -47,6 +45,18 @@ const provider = new OpenFeatureSplitProvider(splitFactory);
4745
OpenFeature.setProvider(provider);
4846
```
4947

48+
### Register the Split provider with OpenFeature using splitClient
49+
```js
50+
const OpenFeature = require('@openfeature/server-sdk').OpenFeature;
51+
const SplitFactory = require('@splitsoftware/splitio').SplitFactory;
52+
const OpenFeatureSplitProvider = require('@splitsoftware/openfeature-js-split-provider').OpenFeatureSplitProvider;
53+
54+
const authorizationKey = 'your auth key'
55+
const splitClient = SplitFactory({core: {authorizationKey}}).client();
56+
const provider = new OpenFeatureSplitProvider({splitClient});
57+
OpenFeature.setProvider(provider);
58+
```
59+
5060
## Use of OpenFeature with Split
5161
After the initial setup you can use OpenFeature according to their [documentation](https://docs.openfeature.dev/docs/reference/concepts/evaluation-api/).
5262

0 commit comments

Comments
 (0)