Feature SDK implementation
Ruby
Feature flags and experiments for Rails, Rack, jobs, and Ruby services.
Ruby serverThis runtime cannot execute inside a Next.js browser process. The page shows the native, official SDK shape; use the JavaScript, React, or Next.js pages for a live decision and event round trip with the same project, flag, event, and visitor ID.
Implementation
Official docs ↗gem install optimizely-sdk
client = Optimizely::Project.new(sdk_key: SDK_KEY)
user = client.create_user_context('visitor-123', { plan: 'pro' })
decision = user.decide('demo_flag')
user.track_event('demo_purchase')