VWO Feature Management and Experimentation SDK for Ruby
Requirements
- Works with 2.2.10 onwards
Installation
gem install vwo-fme-ruby-sdk
Basic usage
Importing and Instantiation
require 'vwo'
# options for initializing SDK
options = {
sdk_key: 'your_sdk_key',
account_id: 'your_account_id',
gateway_service_url: 'http://your.host.com:port', # check section - How to Setup Gateway Service - for more details
}
# Initialize VWO
vwo_instance = VWO.init(options)
# get flag
get_flag_response = vwo_instance.get_flag('feature_key', { id: 'your_user_id'})
# check if feature is enabled
puts get_flag_response.is_enabled()
# get all variables
puts get_flag_response.get_variables()
# get specific variable
puts get_flag_response.get_variable('variable_key', 'default_value')
# track event for a user
track_response = vwo_instance.track_event('event_name', { id: 'your_user_id'})
# set attribute for a user
set_attribute_response = vwo_instance.set_attribute('attribute_key', 'attribute_value', { id: 'your_user_id'})
How to Setup VWO Gateway Service
To Setup the VWO Gateway Service, refer to this.
Authors
Changelog
Refer CHANGELOG.md for detailed changelog.
Contributing
Please go through our contributing guidelines
Code of Conduct
License
Copyright 2024 Wingify Software Pvt. Ltd.