Skip to content

wingify/vwo-fme-java-sdk

Repository files navigation

VWO FME JAVA SDK

CI codecov License

Requirements

The Java SDK supports:

  • Open JDK - 8 onwards
  • Oracle JDK - 8 onwards

Our Build is successful on these Java Versions -

SDK Installation

Install dependencies using mvn install

Add below Maven dependency in your project.

<dependency>
    <groupId>com.vwo.sdk</groupId>
    <artifactId>vwo-fme-java-sdk</artifactId>
    <version>LATEST</version>
</dependency>

Basic Usage

import com.vwo.VWO;
import com.vwo.models.user.VWOContext;
import com.vwo.models.user.GetFlag;
import com.vwo.models.user.VWOInitOptions;

// Initialize VWO SDK
VWOInitOptions vwoInitOptions = new VWOInitOptions();

// Set SDK Key and Account ID
vwoInitOptions.setSdkKey("sdk-key");
vwoInitOptions.setAccountId(123);

// create VWO instance with the vwoInitOptions
VWO vwoInstance = VWO.init(vwoInitOptions);

// Create VWOContext object
VWOContext context = new VWOContext();
// Set User ID
context.setId("user-id");

// Get the GetFlag object for the feature key and context
GetFlag getFlag = vwoInstance.getFlag("feature-key", context);
// Get the flag value
Boolean isFlagEnabled = getFlag.isEnabled();

// Get the variable value for the given variable key and default value
Object variableValue = getFlag.getVariable("stringVar", "default-value");

// Track the event for the given event name and context
Map<String, Boolean> trackResponse = vwoInstance.trackEvent("event-name", context);

// send attributes data
vwoInstance.setAttribute("key", "value", context);

For more appenders, refer this.

Authors

Changelog

Refer CHANGELOG.md

Contributing

Please go through our contributing guidelines

Code of Conduct

Code of Conduct

License

Apache License, Version 2.0

Copyright 2024 Wingify Software Pvt. Ltd.