{"library":"rox-node","title":"CloudBees Feature Management Node.js SDK","description":"The `rox-node` package is the Node.js SDK for CloudBees Feature Management (formerly Rollout.io), offering capabilities for defining and managing feature flags, remote configuration variables, and custom properties within Node.js applications. Currently stable at version 6.0.8, this SDK enables developers to control application features dynamically via the CloudBees Feature Management dashboard, facilitating controlled rollouts, A/B testing, and targeted user experiences. It is designed for enterprise-grade feature management, providing secure and scalable solutions for accelerating development and minimizing deployment risk. The package is updated regularly, with its latest version published approximately four months ago as of late 2025. Key differentiators include its focus on secure feature management, advanced target grouping, and integration with the CloudBees ecosystem, which caters to complex production environments by allowing dynamic control over features without requiring code redeployments.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install rox-node"],"cli":null},"imports":["import Rox from 'rox-node';","const flags = { newFeature: new Rox.Flag(false) };","await Rox.setup(process.env.ROX_SDK_KEY ?? '', options);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import Rox from 'rox-node';\n\n// Define your feature flags in a container object\nconst flags = {\n  enableBetaFeature: new Rox.Flag(false), // Default value is false\n  welcomeMessage: new Rox.RoxString('Hello, User!', ['Welcome!', 'Greetings!', 'Hello, User!']),\n  discountPercentage: new Rox.RoxNumber(0, [0, 5, 10, 15])\n};\n\nasync function initializeFeatureManagement() {\n  const SDK_KEY = process.env.ROX_SDK_KEY ?? 'YOUR_DEFAULT_SDK_KEY'; // Securely get your SDK key\n\n  if (SDK_KEY === 'YOUR_DEFAULT_SDK_KEY') {\n    console.warn('WARNING: ROX_SDK_KEY environment variable not set. Using a default key which may not connect to your dashboard.');\n  }\n\n  // Register the flags with an optional namespace (empty string for global namespace)\n  Rox.register('', flags);\n\n  try {\n    // Initialize the SDK - this connects to the CloudBees Feature Management server\n    await Rox.setup(SDK_KEY, { /* Optional Rox options */ });\n    console.log('CloudBees Feature Management SDK initialized successfully.');\n\n    // Evaluate flags after initialization\n    if (flags.enableBetaFeature.isEnabled()) {\n      console.log('Beta feature is ENABLED!');\n      // Logic for beta feature\n    } else {\n      console.log('Beta feature is DISABLED.');\n    }\n\n    console.log(`Welcome message: ${flags.welcomeMessage.getValue()}`);\n    console.log(`Discount: ${flags.discountPercentage.getValue()}%`);\n\n  } catch (error) {\n    console.error('Failed to initialize CloudBees Feature Management SDK:', error);\n    // Fallback logic if SDK fails to initialize\n    console.log('Using local default values for flags.');\n  }\n}\n\ninitializeFeatureManagement();","lang":"typescript","description":"Demonstrates the asynchronous initialization of the `rox-node` SDK, registration of feature flags (boolean, string, and number types), and evaluation of these flags after setup. It emphasizes using environment variables for the SDK key and includes basic error handling.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}