CloudBees Unify Feature Management SDKs for web platforms provide JavaScript integration for browser applications and server-side rendering environments. Use this reference when implementing feature flags in web applications or troubleshooting SDK integration issues.
Each reference covers SDK version 6.x. Refer to the CloudBees Unify changelog for version-specific differences.
JavaScript browser SDK methods
The JavaScript browser SDK provides the Rox object as the main interface for feature flag management in client-side web applications running in browsers.
Initialize the browser SDK (setup)
This method initializes the SDK with your application key and configuration options for browser environments.
Rox.setup(appKey, options)
Configures the SDK for browser operation and fetches feature flag configuration from CloudBees Unify. Returns a promise that resolves when configuration is retrieved.
Register flag containers (register)
This method registers flag containers to make feature flags available for configuration in the CloudBees Unify UI.
Rox.register(namespace, container)
Registers a container instance containing Flag, RoxString, and RoxNumber objects with CloudBees Unify. The namespace parameter groups related flags for organization.
Browser SDK configuration options
Configuration options control SDK behavior, logging, callback handling, and environment-specific settings for browser applications.
| Parameter | Type | Description |
|---|---|---|
|
String |
JavaScript client version identifier. |
|
String |
SDK verbosity level. Accepts |
|
Function |
Callback executed after configuration sync from CloudBees Unify. |
|
Function |
Callback for flag value computation and evaluation events. |
|
String |
Default freeze level: |
|
String |
Custom platform override for specialized browser environments. |
|
Object |
Custom logger object to override default logging behavior. |
|
Function |
Callback for property condition evaluation without prior configuration. |
|
Object |
Network proxy configuration for SDK requests to CloudBees Unify. |
|
Function |
A function with the standard Fetch API signature |
Display local flag overrides (showOverrides)
This method opens a debug UI for viewing and modifying flag values locally during development.
Rox.showOverrides(position)
Opens the flag override view with controls for testing different flag configurations. Position parameter controls where the debug UI appears on screen.
JavaScript SSR SDK methods
The JavaScript SSR SDK provides server-side rendering support for feature flag management in Node.js environments and universal JavaScript applications.
Initialize the SSR SDK (setup)
This method initializes the SDK with your application key and configuration options for server-side rendering environments.
import {Rox} from 'rox-ssr'; Rox.setup(appKey, options)
Configures the SDK for server-side operation and establishes connection to CloudBees Unify. Returns a promise that resolves when configuration is retrieved.
Register flag containers (register)
This method registers flag containers for server-side flag evaluation and configuration management.
import {RoxNumber, Flag, RoxString, Rox} from 'rox-ssr'; Rox.register(namespace, container)
Registers container instance containing server-side flag definitions with CloudBees Unify. Enables flag configuration through the CloudBees Unify UI for server-rendered content.
Set global evaluation context (setContext)
This method configures global context properties used for flag evaluation across all server requests.
Rox.setContext(context)
Sets static context properties that remain consistent across the server application lifecycle. Context properties enable advanced targeting and flag evaluation logic.
SSR SDK configuration options
Configuration options control server-side SDK behavior, including fetch intervals and callback handling for SSR environments.
| Parameter | Type | Description |
|---|---|---|
|
String |
JavaScript server version identifier. |
|
String |
SDK verbosity level. Accepts |
|
Function |
Callback executed after configuration sync from CloudBees Unify. |
|
Function |
Callback for server-side flag evaluation events. |
|
String |
Custom platform identifier for server environments. |
|
Number |
Configuration refresh interval in seconds. Default: 60, minimum: 30. |
Common JavaScript flag types
JavaScript SDKs support multiple flag types for different data types and use cases in both browser and server environments.
Flag (Boolean flags)
Boolean feature flags for on/off functionality and binary feature switches.
new Flag(defaultValue)
Creates a binary flag that returns true or false based on configuration and targeting rules.
Default value determines the flag state when no configuration is available.
Flag methods
Methods available on Flag instances for value evaluation and status checking.
isEnabled()-
Returns boolean
truewhen the flag is enabled based on current configuration. isEnabled(context)-
Returns boolean
truewhen the flag is enabled, using provided context for evaluation. name-
Returns the flag name (available only after registration).
RoxString (String flags)
String-based feature flags for text content, configuration values, and multi-variant testing.
new RoxString(defaultValue, variations)
Creates a string flag that returns one value from a predefined set of string variations. Supports A/B testing and gradual feature rollouts with different text content.
RoxNumber (Numeric flags)
Numeric feature flags for integers, configuration parameters, and gradual numeric rollouts.
new RoxNumber(defaultValue, variations)
Creates a numeric flag that returns one value from a predefined set of number variations. Enables gradual rollouts and A/B testing with different numeric parameters.
Local flag overrides
JavaScript SDKs provide override capabilities for local development and testing without affecting production configurations.
Set flag overrides (setOverride)
This method overrides flag values locally for development and testing purposes.
Rox.overrides.setOverride(flagName, value)
Sets a local override value that persists until explicitly cleared. Override values take precedence over CloudBees Unify configuration.
SDK lifecycle methods
Methods for managing SDK state, configuration updates, and cleanup operations.
Fetch updated configuration (fetch)
This method manually triggers a configuration update from CloudBees Unify.
Forces an immediate sync with CloudBees Unify to retrieve the latest flag configuration and targeting rules. Useful for ensuring up-to-date configuration without waiting for automatic refresh cycles.
Set custom properties
These methods define custom properties for advanced flag targeting and evaluation logic.
Custom properties enable sophisticated targeting based on user attributes, application state, and environmental conditions. Properties can be static values or dynamic functions computed at evaluation time.
Related pages
-
Install client-side SDKs for JavaScript SDK installation procedures
-
Web application examples for hands-on implementation examples
-
Understanding feature management for conceptual background on feature flag strategies