Nodeschool Public Materials
    Wondering what’s next for npm?Check out our public roadmap! »

    TypeScript icon, indicating that this package has built-in type declarations

    5.0.1 • Public • Published


    Rollout is a Secure Feature Managment Solution for the Enterprise.

    Accelerate development and minimize the risk of deploying new code with simple to create feature flags, controlled rollouts, advanced target groups & deployment rules.

    Getting Started

    Please see the detailed instructions in our docs how to add Rollout to your project.


    Getting started guide, use cases, examples and videos can be found at Rollout support site

    Rollout JS Server Side Rendering (SSR) SDK 🦆

    Rollout JavaScript SSR SDK for web applications that use server side rendering. Define and use simple and advanced feature flags, static and computed custom properties in code. Control your application features via Rollout's dashboard.


    npm i rox-ssr --save


    Basic Usage

    Obtain an application key by registering at

    import {RoxString, RoxNumber, Flag, Rox} from 'rox-ssr';
    const appSettingsContainer = {
      shouldShowWelcome: new Flag(),
      textColor: new RoxString('red', ['green', 'blue']),
      textSize: new RoxNumber(15, [20, 45])
    const onRoxReady = () => {
      if (appSettingsContainer.shouldShowWelcome.isEnabled()) {
        const color = appSettingsContainer.textColor.getValue()
        const size = appSettingsContainer.textSize.getValue()
        const div = document
          .textContent('Hello world!')
          .setAttribute('style', `color: ${color}; font-size: ${size}px`)
        const body = document.getElementsByTagName('body')[0]
    Rox.register('settingsNamespace', appSettingsContainer);
    Rox.setup('<app key>', {
      configurationFetchedHandler: onRoxReady

    Hydrate browser-side Rox with flag configuration

    In order to ensure the consistency of feature flags between the server and the web clients, the Rollout configuration can easily be sent to the clients.

    React example, assuming you already have initialized Rox. Add this to the server-side code, within the <head> tag:

    import {Rox} from 'rox-ssr';
    // ...
    // Your component render() method
    render() {
      return (
            <script type='text/javascript' dangerouslySetInnerHTML={{ __html: `window.rolloutData = ${JSON.stringify(Rox.rolloutData)};` }} />

    The SDK will automatically use the data inside window.rolloutData instead of fetching the configuration from Rollout's servers.

    Configure the SDK with different options

    Override the default configuration by prodiving predefined configuration preset for Rox.setup.

    For example:

    import {Rox} from 'rox-ssr';
    - roxOptions.distinctId
    - roxOptions.version
    - roxOptions.syncComplitionHandler
    const roxOptions = {
      distinctId: 'sessionDistinctId',
      version: '1.0',
      configurationFetchedHandler: () => {}
    Rox.setup('<app key>', roxOptions);

    Activating Manual Overrides UI

    When running in the browser, you can override flags manually using a built-in UI debug utility that can be activated by invoking Rox.showOverrides().

    Running it will display a UI element that allows to explicitly set values of flags. Available UI location of the UI element:

    • 'top left'
    • 'top right'
    • 'bottom left'
    • 'bottom right' (default)


    Rollout client JavaScript Server Side Rendering SDK is free-to-use, proprietary software. Please see the full license found under the LICENSE file for more details.


    Feedback is always welcomed


    npm i rox-ssr

    DownloadsWeekly Downloads






    Unpacked Size

    62 kB

    Total Files



    Last publish


    • avatar
    • avatar
    • avatar
    • avatar