-
Notifications
You must be signed in to change notification settings - Fork 0
running features
Features are resolved through variations of relevant experiences. When you run a feature, the SDK finds all experiences whose variations include a fullStackFeature change linked to that feature, evaluates targeting rules, buckets the visitor, and returns the resolved feature status and variable values. See the data model for the full resolution chain.
Returns a single feature's status and variable values for the current visitor.
feature = context.run_feature("feature-key")
# With attributes (visitor properties are flat top-level keys). Note: this Ruby
# surface always resolves across all experiences — the experienceKeys filter and
# typeCasting flag are not part of it.
feature = context.run_feature("feature-key", {
role: "admin",
location_properties: { url: "/settings" }
})Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| featureKey | string | Yes | The feature's unique key |
| attributes | object | No | Bucketing attributes (see creating a user context for the full attributes reference), plus: |
typeCasting (boolean) -- auto-convert values to the variable's defined type (default: true) |
|||
experienceKeys (string[]) -- limit evaluation to specific experiences only |
Returns all features with their status and variable values for the current visitor.
features = context.run_features
# With attributes (visitor properties are flat top-level keys):
features = context.run_features({
tier: "premium",
location_properties: { url: "/dashboard" }
})Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| attributes | object | No | Bucketing attributes (see creating a user context for the full attributes reference), plus typeCasting (boolean, default: true) |
Returns: An array of BucketedFeature objects.
Each resolved feature is returned as a BucketedFeature with the following fields:
| Field | Type | Description |
|---|---|---|
featureId |
string | The feature ID |
featureKey |
string | The feature key |
status |
string / FeatureStatus |
"enabled" or "disabled" (PHP uses the FeatureStatus enum) |
variables |
object / array | The feature variables with their resolved values |
End-to-end flow: initialize the SDK, create a user context, run a feature, and check its status and variables.
require "convert_sdk"
CONVERT_SDK = ConvertSdk.create(sdk_key: "your-sdk-key")
context = CONVERT_SDK.create_context("user-unique-id")
feature = context.run_feature("feature-key")
# run_feature never returns nil — a miss is a DISABLED BucketedFeature:
if feature.status == ConvertSdk::FeatureStatus::ENABLED
cta_color = feature.variables.fetch("ctaColor", "#0066ff")
endCopyrights © 2026 All Rights Reserved by Convert Insights, Inc.
Getting Started
Ruby SDK
- Quickstart
- Installation
- Initialization
- Configuration
- Return Types & Sentinels
- Code Examples
- Fork Safety & Runtime Recipes
- Tracking Control
Core Concepts
- Experiences & Variations
- Feature Flags
- Bucketing Algorithm
- Rule Evaluation
- Segments
- Data Management
- Event System
- API Communication
How-To Guides
- Running Experiences
- Running Features
- Tracking Conversions
- Visitor Context
- Persistent DataStore
- Troubleshooting
- Direct Tracking Endpoint
- Server-Side Experimentation
- From Tracking Script to SDK
- QA & Preview
- Mutually Exclusive Experiments
- Split URL Tests
Contributing