@@ -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````
6868If 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
72118The 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