{"id":19541310,"url":"https://github.com/wingify/vwo-ruby-sdk","last_synced_at":"2025-04-26T17:30:46.216Z","repository":{"id":44803787,"uuid":"224596870","full_name":"wingify/vwo-ruby-sdk","owner":"wingify","description":"[DEPRECATED] VWO Ruby SDK for server-side A/B Testing","archived":false,"fork":false,"pushed_at":"2025-03-25T14:05:26.000Z","size":323,"stargazers_count":2,"open_issues_count":4,"forks_count":4,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-04T16:12:36.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developers.vwo.com/docs/fullstack-overview","language":"Ruby","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-28T07:42:15.000Z","updated_at":"2025-03-25T14:05:30.000Z","dependencies_parsed_at":"2024-08-26T23:29:47.400Z","dependency_job_id":"e52be4b5-e6e0-4213-ab74-5fd06c33e79b","html_url":"https://github.com/wingify/vwo-ruby-sdk","commit_stats":{"total_commits":49,"total_committers":7,"mean_commits":7.0,"dds":0.653061224489796,"last_synced_commit":"ca463438ec690a4c6a7aa3db91c0d75120a47843"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-ruby-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-ruby-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-ruby-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-ruby-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wingify","download_url":"https://codeload.github.com/wingify/vwo-ruby-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251025567,"owners_count":21524825,"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":[],"created_at":"2024-11-11T03:09:37.124Z","updated_at":"2025-04-26T17:30:46.211Z","avatar_url":"https://github.com/wingify.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚠️ [DEPRECATED] VWO Ruby 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[![Gem version](https://badge.fury.io/rb/vwo-sdk.svg)](https://rubygems.org/gems/vwo-sdk)\n[![CI](https://github.com/wingify/vwo-ruby-sdk/workflows/CI/badge.svg?branch=master)](https://github.com/wingify/vwo-ruby-sdk/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/wingify/vwo-ruby-sdk/branch/master/graph/badge.svg?token=6F5QQEGO5Q)](https://codecov.io/gh/wingify/vwo-ruby-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\n* Works with 2.2.10 onwards\n\n## Installation\n\n```bash\ngem install vwo-sdk\n```\n\n## Basic usage\n\n**Importing and Instantiation**\n\n```ruby\nrequire 'vwo'\n\n# Initialize client\nvwo_client_instance = VWO.new(account_id, sdk_key)\n\n# Initialize client with all parameters(explained in next section)\nvwo_client_instance = VWO.new(account_id, sdk_key, custom_logger, UserStorage.new, true, settings_file)\n\n# Get Settings\nvwo_client_instance.get_settings\n\n# Activate API\n# With Custom Variables\noptions = { \"custom_variable\" =\u003e { \"a\" =\u003e \"x\"}}\nvariation_name = vwo_client_instance.activate(campaign_key, user_id, options)\n\n# Without Custom Variables\noptions = {}\nvariation_name = vwo_client_instance.activate(campaign_key, user_id, options)\n\n# GetVariation\n# With Custom Variables\noptions = { \"custom_variable\" =\u003e { \"a\" =\u003e \"x\"}}\nvariation_name = vwo_client_instance.get_variation_name(campaign_key, user_id, options)\n\n#Without Custom Variables\noptions = {}\nvariation_name = vwo_client_instance.get_variation_name(campaign_key, user_id, options)\n\n# Track API\n# With Custom Variables\noptions = { \"custom_variable\" =\u003e { \"a\" =\u003e \"x\"}}\nis_successful = vwo_client_instance.track(campaign_key, user_id, goal_identifier, options)\n\n# With Revenue Value\noptions = { \"revenue_value\" =\u003e 10.23}\nis_successful = vwo_client_instance.track(campaign_key, user_id, goal_identifier, options)\n\n# With both Custom Variables and Revenue Value\noptions = { \"custom_variable\" =\u003e { \"a\" =\u003e \"x\"}, \"revenue_value\" =\u003e 10.23}\nis_successful = vwo_client_instance.track(campaign_key, user_id, goal_identifier, options)\n\n# FeatureEnabled? API\n# With Custom Varibles\noptions = { \"custom_variable\" =\u003e { \"a\" =\u003e \"x\"}}\nis_successful = vwo_client_instance.feature_enabled?(campaign_key, user_id, options)\n\n# Without Custom Variables\noptions = {}\nis_successful = vwo_client_instance.feature_enabled?(campaign_key, user_id, options)\n\n# GetFeatureVariableValue API\n# With Custom Variables\noptions = { \"custom_variable\" =\u003e { \"a\" =\u003e \"x\"}}\nvariable_value = vwo_client_instance.get_feature_variable_value(campaign_key, variable_key, user_id, options)\n\n# Without Custom Variables\noptions = {}\nvariable_value = vwo_client_instance.get_feature_variable_value(campaign_key, variable_key, user_id, options)\n\n# Push API\nis_successful = vwo_client_instance.push(tag_key, tag_value, user_id)\n```\n\n1. `account_id` - Account for which sdk needs to be initialized\n1. `sdk_key` - SDK key for that account\n1. `logger` - If you need to pass your own logger. Check documentation below\n1. `UserStorage.new` - An object allowing `get` and `set` for maintaining user storage\n1. `development_mode` - on/off (true/false). Default - false\n1. `settings_file` - Settings file if already present during initialization. Its stringified JSON format.\n\n\n**API usage**\n\n**User Defined Logger**\n\nThere are two ways you can use your own custom logging\n\n1. Override Existing Logging\n\n    ```ruby\n      class VWO::Logger\n        def initialize(logger_instance)\n          # Override this two create your own logging instance\n          # Make sure log method is defined on it\n          # i.e @@logger_instance = MyLogger.new(STDOUT)\n          @@logger_instance = logger_instance || Logger.new(STDOUT)\n        end\n\n        # Override this method to handle logs in a custom manner\n        def log(level, message)\n          # Modify level \u0026 Message here\n          # i.e message = \"Custom message #{message}\"\n          @@logger_instance.log(level, message)\n        end\n      end\n    ```\n\n2. Pass your own logger during client initialization\n\n`vwo_client_instance = VWO.new(account_id, sdk_key, user_defined_logger)`\n\n***Note*** - Make sure your logger instance has `log` method which takes `(level, message)` as arguments.\n\n**User Storage**\n\nUse custom UserStorage\n\n    ```ruby\n    class VWO\n      # Abstract class encapsulating user storage service functionality.\n      # Override with your own implementation for storing\n      # And retrieving the user.\n\n      class UserStorage\n\n        # Abstract method, must be defined to fetch the\n        # User storage dict corresponding to the user_id.\n        #\n        # @param[String]        :user_id            ID for user that needs to be retrieved.\n        # @return[Hash]         :user_storage_obj   Object representing the user.\n        #\n        def get(user_id, campaign_key)\n          # example code to fetch it from DB column\n          JSON.parse(User.find_by(vwo_id: user_id).vwo_user)\n        end\n\n        # Abstract method, must be to defined to save\n        # The user dict sent to this method.\n        # @param[Hash]    :user_storage_obj     Object representing the user.\n        #\n        def set(user_data)\n            # example code to save it in DB\n           User.update_attributes(vwo_id: user_data.userId, vwo_user: JSON.generate(user_data))\n        end\n      end\n    end\n\n    # Now use it to initiate VWO client instance\n    vwo_client_instance = VWO.new(account_id, sdk_key, custom_logger, UserStorage.new)\n    ```\n\n## Documentation\n\nRefer [Official VWO Documentation](https://developers.vwo.com/reference#fullstack-introduction)\n\n\n## Code syntax check\n\n```bash\nbundle exec rubocop lib\n```\n\n## Setting up Local development environment\n\n```bash\nchmod +x ./start-dev.sh\nbash start-dev.sh\ngem install\n```\n\n## Running Unit Tests\n\n```bash\nruby tests/test_all_tests.rb\n```\n\n## Third-party Resources and Credits\n\nRefer [third-party-attributions.txt](https://github.com/wingify/vwo-ruby-sdk/blob/master/third-party-attributions.txt)\n\n## Changelog\n\nRefer [CHANGELOG.md](https://github.com/wingify/vwo-ruby-sdk/blob/master/CHANGELOG.md)\n\n## Contributing\n\nPlease go through our [contributing guidelines](https://github.com/wingify/vwo-ruby-sdk/blob/master/CONTRIBUTING.md)\n\n## Code of Conduct\n\n[Code of Conduct](https://github.com/wingify/vwo-ruby-sdk/blob/master/CODE_OF_CONDUCT.md)\n\n## License\n\n[Apache License, Version 2.0](https://github.com/wingify/vwo-ruby-sdk/blob/master/LICENSE)\n\nCopyright 2019-2025 Wingify Software Pvt. Ltd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-ruby-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwingify%2Fvwo-ruby-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-ruby-sdk/lists"}