{"id":19541331,"url":"https://github.com/wingify/vwo-java-sdk","last_synced_at":"2025-04-26T17:30:46.227Z","repository":{"id":46269168,"uuid":"199641120","full_name":"wingify/vwo-java-sdk","owner":"wingify","description":"[DEPRECATED] VWO Java SDK for server-side A/B Testing","archived":false,"fork":false,"pushed_at":"2025-03-25T14:07:02.000Z","size":5066,"stargazers_count":9,"open_issues_count":2,"forks_count":4,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-04T16:12:35.786Z","etag":null,"topics":["ab-testing","java","java-sdk","murmurhash3","server-side","server-side-rendering","vwo"],"latest_commit_sha":null,"homepage":"https://developers.vwo.com/docs/fullstack-overview","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wingify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-30T11:46:15.000Z","updated_at":"2025-03-25T14:07:06.000Z","dependencies_parsed_at":"2023-11-22T16:50:31.936Z","dependency_job_id":null,"html_url":"https://github.com/wingify/vwo-java-sdk","commit_stats":null,"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-java-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-java-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-java-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-java-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wingify","download_url":"https://codeload.github.com/wingify/vwo-java-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251025568,"owners_count":21524826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ab-testing","java","java-sdk","murmurhash3","server-side","server-side-rendering","vwo"],"created_at":"2024-11-11T03:09:54.453Z","updated_at":"2025-04-26T17:30:46.222Z","avatar_url":"https://github.com/wingify.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚠️ [DEPRECATED] VWO JAVA SDK\n\n**⚠️ This project is no longer actively developed. ⚠️**\n\n**✅ We are only fixing critical bugs and security issues.**\n\n**❌ No new features, enhancements, or non-critical updates will be added.**\n\n#### Switch to *VWO Feature Management \u0026 Experimentation(FME)* – The Better Alternative! 🚀\n\nVWO’s FME product empowers teams to seamlessly test, release, optimize, and roll back features across their entire tech stack while minimizing risk and maximizing business impact.\n\n* Check out FME developer documentation [here](https://developers.vwo.com/v2/docs/fme-overview).\n* Check [this](https://developers.vwo.com/v2/docs/sdks-release-info ) for the list of all FME-supported SDKs.\n\n**💡 Need Help?**\nFor migration assistance or any questions, contact us at [support@vwo.com](support@vwo.com)\n\n------\n\n[![CI](https://github.com/wingify/vwo-java-sdk/workflows/CI/badge.svg?branch=master)](https://github.com/wingify/vwo-java-sdk/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/wingify/vwo-java-sdk/branch/master/graph/badge.svg?token=WZ9LNISPPJ)](https://codecov.io/gh/wingify/vwo-java-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n\nThis open source library allows you to A/B Test your Website at server-side.\n\n## Requirements\n\nThe Java SDK supports:\n\n* Open JDK 8, 9, 11, 12, 13, 15, 17\n* Oracle JDK 8, 9, 11, 12, 13, 15, 17\n\nOur [Build](https://github.com/wingify/vwo-java-sdk/actions) is successful on these Java Versions - `8, 11, 12, 13, 15, 17`\n\n## SDK Installation\n\nInstall dependencies using `mvn install`\n\nAdd below Maven dependency in your project.\n\n\n```java\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.vwo.sdk\u003c/groupId\u003e\n    \u003cartifactId\u003evwo-java-sdk\u003c/artifactId\u003e\n    \u003cversion\u003eLATEST\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Documentation\n\nRefer [Official VWO Documentation](https://developers.vwo.com/docs/fullstack-overview)\n\n## Basic Usage\n\n**GET SETTINGS FILE**\n\nEach VWO SDK client corresponds to the settingsFIle representing the current state of the campaign settings, that is, a list of server-side running campaign settings.\nSetting File is a pre-requisite for initiating the VWO CLIENT INSTANCE.\n\n```java\nString settingsFile = VWO.getSettingsFile(accountId, sdkKey));\n```\n\n**INSTANTIATION**\n\n\nSDK provides a method to instantiate a VWO client as an instance. The method accepts an object to configure the VWO client.\nThe mandatory parameter for instantiating the SDK is settingsFile.\n\n```java\nimport com.vwo.VWO;\n\nVWO vwoInstance = VWO.launch(settingsFile).build();\n```\n\n**Activate API**\n\n```java\nString variationName = vwoClientInstance.activate(campaignKey, userId, options);\n\nif (variationName.equals(\"Control\")) {\n  // Write code for handling 'Control'\n} else if (variationName.equals(\"Variation-1\")) {\n  // CODE: write code for Variation-1\n} else {\n  // CODE: When user does not become part of campaign.\n}\n```\n\n**Track API**\n\n```java\n// For CUSTOM goal type\nboolean isSuccessful = vwoClientInstance.track(campaignKey, userId, goalIdentifier, options);\n\n// For REVENUE goal type\nboolean isSuccessful = vwoClientInstance.track(campaignKey, userId, goalIdentifier, options);\n```\n\n**Feature Enabled API**\n\n```java\nBoolean isEnabled = vwoClientInstance.isFeatureEnabled(campaignKey, userId, options);\n\nif (isEnabled) {\n  // Write code for handling feature enabled\n} else {\n  // CODE: User is not qualified for the campaign. Would be due to configuring campaign's percent-traffic less than 100% while creating or updating a FullStack campaign.\n}\n```\n\n**Get Variable Value API**\n\n```java\nObject value = vwoClientInstance.getFeatureVariableValue(campaignKey, variableKey, userId, options);\n```\n\n**Push API**\n\n```java\nboolean isSuccessful = vwoClientInstance.push(customDimensionKey, customDimensionValue, userId);\n```\n\nThe VWO client class needs to be instantiated as an instance that exposes various API methods like activate, getVariation and track.\n\n**USER STORAGE SERVICE**\n\n```java\nString settingsFile = VWO.getSettingsFile(accountId, sdkKey);\n\nStorage.User userStorage = return new Storage.User() {\n     @Override\n     public Map\u003cString, String\u003e get(String userId, String campaignName) {\n        for (Map\u003cString, String\u003e savedCampaign: campaignStorageArray) {\n            if (savedCampaign.get(\"userId\").equals(userId) \u0026\u0026 savedCampaign.get(\"campaignKey\").equals(campaignName)) {\n               return savedCampaign;\n            }\n        }\n        return null;\n     }\n\n     @Override\n     public void set(Map\u003cString, String\u003e map){\n        campaignStorageArray.add(map);\n     }\n};\n\nVWO vwo = VWO.launch(settingsFile).withUserStorage(userStorage).build();\n```\n\n**LOGGER**\n\nJAVA SDK utilizes a logging facade, SL4J (https://www.slf4j.org/) as the logging api layer. If no binding is found on the class path,\nthen you will see the following logs\n\n```\nSLF4J: Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".\nSLF4J: Defaulting to no-operation (NOP) logger implementation\nSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\nYou can get the SDK to log by providing a concrete implementation for SLF4J.\n```\n\nWhat it means is that at runtime, the logging `implementation` (or the logger binding) is missing , so slf4j simply use a \"NOP\" implementation, which does nothing.\nIf you need to output JAVA SDK logs, there are different approaches for the same.\n\nSIMPLE IMPLEMENTATION\nIf there are no implementation in your project , you may provide a simple implementation that does not require any configuration at all.\nAdd following code to you pom.xml,\n\n```java\n \u003cdependency\u003e\n    \u003cgroupId\u003eorg.slf4j\u003c/groupId\u003e\n    \u003cartifactId\u003eslf4j-simple\u003c/artifactId\u003e\n    \u003cversion\u003e1.6.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nNow you see logging output on STDOUT with INFO level. This simple logger will default show any INFO level message or higher.\nIn order to see DEBUG messages, you would need to pass -Dorg.slf4j.simpleLogger.defaultLogLevel=debug or simplelogger.properties file on the classpath\nSee http://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html for details\n\nCONCRETE IMPLEMENTATION\n\nsl4j supports various logging framework. Refer here -\u003ehttps://www.slf4j.org/manual.html\n\nWe have provided our example with Logback\nIf you have logback in your class path, to get console logs add following Appender and Logger in logback for formatted logs.\n\n```java\n\u003cappender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\"\u003e\n    \u003cencoder class=\"ch.qos.logback.classic.encoder.PatternLayoutEncoder\"\u003e\n        \u003cPattern\u003e\n            %cyan(VWO-SDK) [%date] %highlight([%level]) %cyan([%logger{10} %file:%line]) %msg%n\n        \u003c/Pattern\u003e\n    \u003c/encoder\u003e\n\n    \u003cfilter class=\"ch.qos.logback.classic.filter.ThresholdFilter\"\u003e\n        \u003clevel\u003eDEBUG\u003c/level\u003e\n    \u003c/filter\u003e\n\u003c/appender\u003e\n\n\u003cLogger name=\"com.vwo.sdk\" additivity=\"false\"\u003e\n    \u003cappender-ref ref=\"STDOUT\"/\u003e\n\u003c/Logger\u003e\n```\n\n```java\nnew VWOLogger(VWO.Enums.LOGGER_LEVEL.DEBUG.value()) {\n    @Override\n    public void trace(String message, Object... params) {\n        LOGGER.trace(message, params);\n    }\n\n    @Override\n    public void debug(String message, Object... params) {\n        LOGGER.debug(message, params);\n    }\n\n    @Override\n    public void info(String message, Object... params) {\n        LOGGER.info(message, params);\n    }\n\n    @Override\n    public void warn(String message, Object... params) {\n        LOGGER.warn(message, params);\n    }\n\n    @Override\n    public void error(String message, Object... params) {\n        LOGGER.error(message, params);\n    }\n};\n```\n\nFor more appenders, refer [this](https://logback.qos.ch/manual/appenders.html).\n\n## Third-party Resources and Credits\n\nRefer [third-party-attributions.txt](https://github.com/wingify/vwo-java-sdk/blob/master/third-party-attributions.txt)\n\n## Authors\n\n* Core Contributor \u0026 Maintainer - [pntgupta](https://github.com/pntgupta)\n* Main Contributor - [sakshimahendruvk](https://github.com/sakshimahendruvk)\n* Repo health maintainer - [softvar](https://github.com/softvar)\n\n## Changelog\n\nRefer [CHANGELOG.md](https://github.com/wingify/vwo-java-sdk/blob/master/CHANGELOG.md)\n\n## Contributing\n\nPlease go through our [contributing guidelines](https://github.com/wingify/vwo-java-sdk/blob/master/CONTRIBUTING.md)\n\n## Code of Conduct\n\n[Code of Conduct](https://github.com/wingify/vwo-java-sdk/blob/master/CODE_OF_CONDUCT.md)\n\n## License\n\n[Apache License, Version 2.0](https://github.com/wingify/vwo-java-sdk/blob/master/LICENSE)\n\nCopyright 2019-2022 Wingify Software Pvt. Ltd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-java-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwingify%2Fvwo-java-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-java-sdk/lists"}