Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
1.2.0 (August XX, 2025)
1.2.0 (September 2, 2025)
- Updated `io.split.client` dependency to 4.16.1
- Updated `dev.openfeature` dependency to 1.17.0
- Added tracking support
- Added “evaluate with details” support

1.1.0
- Up tp date with spec v0.5.0 and java sdk v0.3.1
Expand Down
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This SDK is compatible with Java 11 and higher.
<dependency>
<groupId>io.split.openfeature</groupId>
<artifactId>split-openfeature-provider</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
</dependency>
```
### Configure it
Expand Down Expand Up @@ -67,6 +67,52 @@ OpenFeatureAPI.getInstance().setEvaluationContext(context)
````
If the context was set at the client or api level, it is not required to provide it during flag evaluation.

## Evaluate with details

Use the get*Details(...) APIs to get the value and rich context (variant, reason, error code, metadata).
This provider includes the Split treatment config as a raw JSON string under flagMetadata["config"]
```java
// boolean/string/number/object all have *Details variants:
FlagEvaluationDetails<String> details =
client.getStringDetails("my-flag", "fallback", ctx);

Metadata md = details.getFlagMetadata();
if (md != null) {

Map<String, Value> meta = md.asMap();

Value config = meta.get("config"); // ← Split treatment config
}
```

## Tracking
To use track(eventName, context, details) you must provide:

- targetingKey on the EvaluationContext (non-blank).

- trafficType in the context (string, e.g. "user" or "account").

- A non-blank eventName.

Optional:

- details.value: numeric event value (defaults to 0).

- details.properties: map of attributes (prefer primitives: string/number/boolean/null).

Example:

```java
MutableContext ctx = new MutableContext("user-123");
ctx.add("trafficType", new Value("user"));

TrackingEventDetails details = new MutableTrackingEventDetails(19.99)
.add("plan", new Value("pro"))
.add("coupon", new Value("WELCOME10"));

client.track("checkout.completed", ctx, details);
```

## Submitting issues

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.
Expand Down
Loading