Skip to content

Commit fb5b9b4

Browse files
Merge pull request #34 from splitio/development
release 1.2.0
2 parents 04bf683 + 17b8333 commit fb5b9b4

File tree

3 files changed

+87
-32
lines changed

3 files changed

+87
-32
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 3, 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: 49 additions & 3 deletions
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
@@ -24,7 +24,7 @@ import dev.openfeature.sdk.OpenFeatureAPI;
2424
import io.split.openfeature.SplitProvider;
2525

2626
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
27-
api.setProvider(new SplitProvider("YOUR_API_KEY"));
27+
api.setProviderAndWait(new SplitProvider("YOUR_API_KEY"));
2828
```
2929

3030
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.
@@ -42,7 +42,7 @@ SplitClientConfig config = SplitClientConfig.builder()
4242
.setBlockUntilReadyTimeout(10000)
4343
.build();
4444
SplitClient splitClient = SplitFactoryBuilder.build("YOUR_API_KEY", config).client();
45-
api.setProvider(new SplitProvider(splitClient));
45+
api.setProviderAndWait(new SplitProvider(splitClient));
4646
```
4747

4848
## Use of OpenFeature with Split
@@ -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.

pom.xml

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<properties>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
<maven.compiler.release>11</maven.compiler.release>
37-
<junit.jupiter.version>5.10.2</junit.jupiter.version>
37+
<junit.jupiter.version>5.13.4</junit.jupiter.version>
3838
<maven.surefire.version>3.2.5</maven.surefire.version>
3939
</properties>
4040
<dependencies>
@@ -47,29 +47,34 @@
4747
<dependency>
4848
<groupId>io.split.client</groupId>
4949
<artifactId>java-client</artifactId>
50-
<version>4.16.1</version>
50+
<version>4.17.0</version>
5151
</dependency>
5252
<dependency>
5353
<groupId>org.apache.httpcomponents</groupId>
5454
<artifactId>httpclient</artifactId>
5555
<version>4.5.14</version>
5656
</dependency>
57-
<dependency>
58-
<groupId>io.split.integrations.azure</groupId>
59-
<artifactId>impressions-listener</artifactId>
60-
<version>0.9.1</version>
61-
</dependency>
6257
<dependency>
6358
<groupId>org.mockito</groupId>
6459
<artifactId>mockito-core</artifactId>
65-
<version>3.4.6</version>
60+
<version>5.19.0</version>
6661
<scope>test</scope>
6762
</dependency>
6863
<dependency>
6964
<groupId>dev.openfeature</groupId>
7065
<artifactId>sdk</artifactId>
7166
<version>1.17.0</version>
7267
</dependency>
68+
<dependency>
69+
<groupId>com.fasterxml.jackson.core</groupId>
70+
<artifactId>jackson-core</artifactId>
71+
<version>2.20.0</version>
72+
</dependency>
73+
<dependency>
74+
<groupId>com.fasterxml.jackson.core</groupId>
75+
<artifactId>jackson-databind</artifactId>
76+
<version>2.20.0</version>
77+
</dependency>
7378
</dependencies>
7479
<build>
7580
<pluginManagement>
@@ -78,49 +83,49 @@
7883
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
7984
<plugin>
8085
<artifactId>maven-clean-plugin</artifactId>
81-
<version>3.1.0</version>
86+
<version>3.5.0</version>
8287
</plugin>
8388
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
8489
<plugin>
8590
<artifactId>maven-resources-plugin</artifactId>
86-
<version>3.0.2</version>
91+
<version>3.3.1</version>
8792
</plugin>
8893
<plugin>
8994
<artifactId>maven-compiler-plugin</artifactId>
90-
<version>3.8.0</version>
95+
<version>3.14.0</version>
9196
</plugin>
9297
<plugin>
9398
<artifactId>maven-surefire-plugin</artifactId>
94-
<version>2.22.1</version>
99+
<version>3.5.3</version>
95100
</plugin>
96101
<plugin>
97102
<artifactId>maven-jar-plugin</artifactId>
98-
<version>3.0.2</version>
103+
<version>3.4.2</version>
99104
</plugin>
100105
<plugin>
101106
<artifactId>maven-install-plugin</artifactId>
102-
<version>2.5.2</version>
107+
<version>3.1.4</version>
103108
</plugin>
104109
<plugin>
105110
<artifactId>maven-deploy-plugin</artifactId>
106-
<version>2.8.2</version>
111+
<version>3.1.4</version>
107112
</plugin>
108113
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
109114
<plugin>
110115
<artifactId>maven-site-plugin</artifactId>
111-
<version>3.7.1</version>
116+
<version>3.21.0</version>
112117
</plugin>
113118
<plugin>
114119
<artifactId>maven-project-info-reports-plugin</artifactId>
115-
<version>3.0.0</version>
120+
<version>3.9.0</version>
116121
</plugin>
117122
</plugins>
118123
</pluginManagement>
119124
<plugins>
120125
<plugin>
121126
<groupId>org.apache.maven.plugins</groupId>
122127
<artifactId>maven-compiler-plugin</artifactId>
123-
<version>3.13.0</version>
128+
<version>3.14.0</version>
124129
<configuration>
125130
<source>11</source>
126131
<target>11</target>
@@ -143,15 +148,6 @@
143148
</execution>
144149
</executions>
145150
</plugin>
146-
<plugin>
147-
<groupId>org.sonatype.plugins</groupId>
148-
<artifactId>nexus-staging-maven-plugin</artifactId>
149-
<version>1.6.13</version>
150-
<extensions>true</extensions>
151-
<configuration>
152-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
153-
</configuration>
154-
</plugin>
155151
<plugin>
156152
<groupId>org.apache.maven.plugins</groupId>
157153
<artifactId>maven-source-plugin</artifactId>
@@ -168,7 +164,7 @@
168164
<plugin>
169165
<groupId>org.apache.maven.plugins</groupId>
170166
<artifactId>maven-gpg-plugin</artifactId>
171-
<version>1.5</version>
167+
<version>3.2.8</version>
172168
<executions>
173169
<execution>
174170
<id>sign-artifacts</id>
@@ -179,6 +175,17 @@
179175
</execution>
180176
</executions>
181177
</plugin>
178+
<plugin>
179+
<groupId>org.sonatype.central</groupId>
180+
<artifactId>central-publishing-maven-plugin</artifactId>
181+
<version>0.7.0</version>
182+
<extensions>true</extensions>
183+
<configuration>
184+
<publishingServerId>central</publishingServerId>
185+
<autoPublish>false</autoPublish>
186+
<waitUntil>published</waitUntil>
187+
</configuration>
188+
</plugin>
182189
</plugins>
183190
</build>
184191
</project>

0 commit comments

Comments
 (0)