Skip to content

Commit 5b299f7

Browse files
Update README.md
1 parent 7bb610f commit 5b299f7

File tree

1 file changed

+93
-1
lines changed

1 file changed

+93
-1
lines changed

README.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,95 @@
11
# Split OpenFeature Provider for Java
2+
[![Twitter Follow](https://img.shields.io/twitter/follow/splitsoftware.svg?style=social&label=Follow&maxAge=1529000)](https://twitter.com/intent/follow?screen_name=splitsoftware)
3+
4+
## Overview
5+
This Provider is designed to allow the use of OpenFeature with Split, the platform for controlled rollouts, serving features to your users via the Split feature flag to manage your complete customer experience.
6+
7+
## Compatibility
8+
This SDK is compatible with Java 11 and higher.
9+
10+
## Getting started
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+
13+
```java
14+
import dev.openfeature.javasdk.OpenFeatureAPI;
15+
import io.split.openfeature.SplitProvider
16+
17+
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
18+
api.setProvider(new SplitProvider("YOUR_API_KEY"));
19+
```
20+
21+
If you are more familiar with Split or want access to other initialization options, you can provide a `SplitClient` to the constructor. See the [Split Java SDK Documentation](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK) for more information.
22+
```java
23+
import dev.openfeature.javasdk.OpenFeatureAPI;
24+
import io.split.openfeature.SplitProvider
25+
import io.split.client.SplitClient;
26+
import io.split.client.SplitClientConfig;
27+
import io.split.client.SplitFactoryBuilder;
28+
29+
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
30+
31+
32+
SplitClientConfig config = SplitClientConfig.builder()
33+
.setBlockUntilReadyTimeout(10000)
34+
.build();
35+
SplitClient splitClient = SplitFactoryBuilder.build("YOUR_API_KEY", config).client();
36+
api.setProvider(new SplitProvider(splitClient));
37+
```
38+
39+
## Use of OpenFeature with Split
40+
After the initial setup you can use OpenFeature according to their [documentation](https://docs.openfeature.dev/docs/reference/concepts/evaluation-api/).
41+
42+
One important note is that the Split Provider **requires a targeting key** to be set. Often times this should be set when evaluating the value of a flag by [setting an EvaluationContext](https://docs.openfeature.dev/docs/reference/concepts/evaluation-context) which contains the targeting key. An example flag evaluation is
43+
```java
44+
Client client = api.getClient("CLIENT_NAME");
45+
46+
EvaluationContext context = new EvaluationContext("TARGETING_KEY");
47+
Boolean boolValue = client.getBooleanValue("boolFlag", false, context);
48+
```
49+
If the same targeting key is used repeatedly, the evaluation context may be set at the client level
50+
```java
51+
EvaluationContext context = new EvaluationContext("TARGETING_KEY");
52+
client.setEvaluationContext(context)
53+
```
54+
or at the OpenFeatureAPI level
55+
```java
56+
EvaluationContext context = new EvaluationContext("TARGETING_KEY");
57+
OpenFeatureAPI.getInstance().setCtx(context)
58+
````
59+
If the context was set at the client or api level, it is not required to provide it during flag evaluation.
60+
61+
## Submitting issues
62+
63+
The Split team monitors all issues submitted to this [issue tracker](https://github.com/splitio/split-openfeature-provider-java/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.
64+
65+
## Contributing
66+
Please see [Contributors Guide](CONTRIBUTORS-GUIDE.md) to find all you need to submit a Pull Request (PR).
67+
68+
## License
69+
Licensed under the Apache License, Version 2.0. See: [Apache License](http://www.apache.org/licenses/).
70+
71+
## About Split
72+
73+
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.
74+
75+
To learn more about Split, contact hello@split.io, or get started with feature flags for free at https://www.split.io/signup.
76+
77+
Split has built and maintains SDKs for:
78+
79+
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
80+
* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
81+
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
82+
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
83+
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
84+
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
85+
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
86+
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
87+
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
88+
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
89+
90+
For a comprehensive list of open source projects visit our [Github page](https://github.com/splitio?utf8=%E2%9C%93&query=%20only%3Apublic%20).
91+
92+
**Learn more about Split:**
93+
94+
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.
295

3-
This contains the Java Split Provider for OpenFeature.

0 commit comments

Comments
 (0)