
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
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.
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 JavaScript SSR SDK for web applications that use server side rendering. Define and use simple and advanced feature flags, remote configuration variables, static and computed custom properties in code. Control your application features via Rollout's dashboard.
npm i rox-ssr --save
Obtain an application key by registering at Rollout.io.
import {Configuration, Flag, Rox} from 'rox-ssr';
const appSettingsContainer = {
shouldShowWelcome: new Flag(),
textColor: new Configuration('black')
};
const onRoxReady = () => {
if (appSettingsContainer.shouldShowWelcome.isEnabled()) {
const color = appSettingsContainer.textColor.getValue()
const div = document
.createElement('div')
.textContent('Hello world!')
.setAttribute('style', `color: ${color}`);
const body = document.getElementsByTagName('body')[0]
body.appendChild(div)
}
};
Rox.register('settingsNamespace', appSettingsContainer);
Rox.setup('<app key>', {
configurationFetchedHandler: onRoxReady
});
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 (
<html>
<head>
<script type='text/javascript' dangerouslySetInnerHTML={{ __html: `window.rolloutData = ${JSON.stringify(Rox.rolloutData)};` }} />
<head>
</html>)
}
The SDK will automatically use the data inside window.rolloutData
instead of fetching the configuration from Rollout's servers.
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);
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 support@rollout.io
FAQs
Rollout.io ROX JS SDK Client for SSR
The npm package rox-ssr receives a total of 2,725 weekly downloads. As such, rox-ssr popularity was classified as popular.
We found that rox-ssr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.