Skip to content

Releases: wingify/vwo-fme-ruby-sdk

Version 1.0.0

09 Oct 14:00
Compare
Choose a tag to compare

First release of VWO Feature Management and Experimentation capabilities

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 status
get_flag_response = vwo_instance.get_flag('feature_key', { id: 'your_user_id'})
puts get_flag_response.is_enabled()
puts get_flag_response.get_variables()
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'})