Skip to content

Commit 45e9653

Browse files
README: add OpenFeature client initialization and fix typo in context example
1 parent 4ee3fe2 commit 45e9653

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ const splitFactory = SplitFactory({
3131
key: 'TARGETING_KEY'
3232
}
3333
});
34+
3435
const provider = new OpenFeatureSplitProvider(splitFactory);
3536

36-
// Wait for the default SDK client for 'TARGETING_KEY' to be ready
37+
// Register provider and wait for the default SDK client for 'TARGETING_KEY' to be ready
3738
await OpenFeature.setProviderAndWait(provider);
39+
40+
const client = OpenFeature.getClient();
3841
```
3942

4043
## Use of OpenFeature with Split
@@ -65,8 +68,9 @@ Evaluation attributes must be set in context before evaluation
6568
const context: EvaluationContext = {
6669
targetingKey: 'TARGETING_KEY',
6770
trafficType: 'account',
71+
// Evaluation attributes:
6872
plan: 'premium',
69-
couppon: 'WELCOME10'
73+
coupon: 'WELCOME10'
7074
};
7175
await OpenFeature.setContext(context);
7276
const booleanTreatment = client.getBooleanDetails('boolFlag', false);
@@ -96,7 +100,7 @@ await client.setContext(context)
96100
client.track('checkout.completed', details)
97101
```
98102
## Submitting issues
99-
103+
100104
The Split team monitors all issues submitted to this [issue tracker](https://github.com/splitio/split-openfeature-provider-web-js/issues). We encourage you to use this issue tracker to submit any bug reports, feedback, and feature enhancements. We'll do our best to respond in a timely manner.
101105

102106
## Contributing
@@ -106,13 +110,13 @@ Please see [Contributors Guide](CONTRIBUTORS-GUIDE.md) to find all you need to s
106110
Licensed under the Apache License, Version 2.0. See: [Apache License](http://www.apache.org/licenses/).
107111

108112
## About Split
109-
113+
110114
Split is the leading Feature Delivery Platform for engineering teams that want to confidently deploy features as fast as they can develop them. Split’s fine-grained management, real-time monitoring, and data-driven experimentation ensure that new features will improve the customer experience without breaking or degrading performance. Companies like Twilio, Salesforce, GoDaddy and WePay trust Split to power their feature delivery.
111-
115+
112116
To learn more about Split, contact hello@split.io, or get started with feature flags for free at https://www.split.io/signup.
113-
117+
114118
Split has built and maintains SDKs for:
115-
119+
116120
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
117121
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
118122
* Angular [Github](https://github.com/splitio/angular-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/6495326064397-Angular-utilities)
@@ -131,10 +135,9 @@ Split has built and maintains SDKs for:
131135
* React Native [Github](https://github.com/splitio/react-native-client) [Docs](https://help.split.io/hc/en-us/articles/4406066357901-React-Native-SDK)
132136
* Redux [Github](https://github.com/splitio/redux-client) [Docs](https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK)
133137
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
134-
138+
135139
For a comprehensive list of open source projects visit our [Github page](https://github.com/splitio?utf8=%E2%9C%93&query=%20only%3Apublic%20).
136-
140+
137141
**Learn more about Split:**
138-
139-
Visit [split.io/product](https://www.split.io/product) for an overview of Split, or visit our documentation at [help.split.io](http://help.split.io) for more detailed information.
140142

143+
Visit [split.io/product](https://www.split.io/product) for an overview of Split, or visit our documentation at [help.split.io](http://help.split.io) for more detailed information.

0 commit comments

Comments
 (0)