The Java SDK supports:
- Open JDK - 8 onwards
- Oracle JDK - 8 onwards
Install dependencies using mvn install
Add below Maven dependency in your project.
<dependency>
<groupId>com.vwo.sdk</groupId>
<artifactId>vwo-openfeature-provider-java</artifactId>
<version>LATEST</version>
</dependency>
import dev.openfeature.sdk.*;
import com.vwo.VWOProvider;
import java.util.Map;
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
Map<String, Object> options = new HashMap<>();
options.put("accountId", 1234);
options.put("sdkKey", "32-alpha-numeric-sdk-key");
api.setProvider(new VWOProvider(vwoClient));
EvaluationContext context = new ImmutableContext(new HashMap() {
{
put("userId", new Value("user1")); // userId
put("key", new Value("variableKey")); // variable key
put("customVariables", new Value(new ImmutableContext(new HashMap() {
{
put("key", new Value("value"));
}
})));
}
});
Client vwoClient = api.getClient("vwo-openfeature-provider-java-provider");
apiClient.getStringValue("featureKey", "defaultValue", context)
For more appenders, refer this.
Refer CHANGELOG.md
Please go through our contributing guidelines
Copyright 2024 Wingify Software Pvt. Ltd.