Skip to content

Commit 46664b9

Browse files
Merge pull request #31 from splitio/prepare-release
Update readme and changes file
2 parents 49aa2d4 + fadf25c commit 46664b9

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

CHANGES.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
1.2.0 (August XX, 2025)
1+
1.2.0 (September 2, 2025)
22
- Updated `io.split.client` dependency to 4.16.1
33
- Updated `dev.openfeature` dependency to 1.17.0
4+
- Added tracking support
5+
- Added “evaluate with details” support
46

57
1.1.0
68
- Up tp date with spec v0.5.0 and java sdk v0.3.1

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This SDK is compatible with Java 11 and higher.
1313
<dependency>
1414
<groupId>io.split.openfeature</groupId>
1515
<artifactId>split-openfeature-provider</artifactId>
16-
<version>1.1.0</version>
16+
<version>1.2.0</version>
1717
</dependency>
1818
```
1919
### Configure it
@@ -67,6 +67,52 @@ OpenFeatureAPI.getInstance().setEvaluationContext(context)
6767
````
6868
If the context was set at the client or api level, it is not required to provide it during flag evaluation.
6969

70+
## Evaluate with details
71+
72+
Use the get*Details(...) APIs to get the value and rich context (variant, reason, error code, metadata).
73+
This provider includes the Split treatment config as a raw JSON string under flagMetadata["config"]
74+
```java
75+
// boolean/string/number/object all have *Details variants:
76+
FlagEvaluationDetails<String> details =
77+
client.getStringDetails("my-flag", "fallback", ctx);
78+
79+
Metadata md = details.getFlagMetadata();
80+
if (md != null) {
81+
82+
Map<String, Value> meta = md.asMap();
83+
84+
Value config = meta.get("config"); // ← Split treatment config
85+
}
86+
```
87+
88+
## Tracking
89+
To use track(eventName, context, details) you must provide:
90+
91+
- targetingKey on the EvaluationContext (non-blank).
92+
93+
- trafficType in the context (string, e.g. "user" or "account").
94+
95+
- A non-blank eventName.
96+
97+
Optional:
98+
99+
- details.value: numeric event value (defaults to 0).
100+
101+
- details.properties: map of attributes (prefer primitives: string/number/boolean/null).
102+
103+
Example:
104+
105+
```java
106+
MutableContext ctx = new MutableContext("user-123");
107+
ctx.add("trafficType", new Value("user"));
108+
109+
TrackingEventDetails details = new MutableTrackingEventDetails(19.99)
110+
.add("plan", new Value("pro"))
111+
.add("coupon", new Value("WELCOME10"));
112+
113+
client.track("checkout.completed", ctx, details);
114+
```
115+
70116
## Submitting issues
71117

72118
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.

0 commit comments

Comments
 (0)