Stormkit LogoStormkit Logo WhiteStormkit

Remote configuration

It's easy to configure your application remotely on Stormkit. You can have a remote configuration per application environment and you can provide as many parameters as you'd like to. To start using the remote configuration, click on the application environment you'd like to configure and then the Remote Config link.Remote Config

Parameter details

Parameter nameThe name of the parameter. You'll provide this name in your source code to retrieve the respective value. This field is required.
DescriptionA helper text that is used internally which describes what the parameter is used for. This is optional.

Values

The possible values this parameter can take. You can provide multiple variables.

ValueThe value of the parameter. The application will always receive string values. This field is required.
Apply ifIf one of the options in the dropdown is specified, this value will be shown to the user only if the criteria match. The order is important and the first value that matches the criteria will be displayed.
User in percentileIf specified, the user will have X percent of chance to see this value. Once a user sees a version, it sticks. Consequent calls to this parameter will display the same value for the user. If a user already belongs to a bucket and the percentile is changed meanwhile, the result will be re-calculated. When the percentage is increased, the user will continue to see the same value, when it is decreased, it is not guaranteed that the user will continue to see the same value. We use a cookie to do this calculation. Please make sure you have relevant GDPR compliances. The cookie expires after 15 days of no access to this parameter.
User segment matchesA regex string that tells Stormkit to display the value only if the user is identified in the desired segment. You will need to identify the user before accessing this parameter for this condition to work.
App version matchesA number value which tells Stormkit to display the value only if the application version matches the given condition. You can use the > and <operators to match multiple versions. For instance< 10. To match the exact version, omit the operator and provide only the version number. This field works only with numeric values.

You can access these settings in your code by using our open source @stormkit/apipackage.

Here's an example:import React from "react"; import sk from "@stormkit/api"; const App = () => { // Here `Enable promotions` is the parameter name specified in the UI. if (sk.config().get("Enable promotions") === "true") { return <div>25% discount</div> } return <div>Full price</div> } export default App;

Identifying the segment and version

For User segment matches and App version matches conditions to work, you'll need to identify the user before accessing these parameters. You can do so as follows:import sk from "@stormkit/api"; sk.context({ segment: "my-segment", version: 16 }); sk.config().get("Enable promotions"); If the Enable Promotions parameter has a condition to match users in segment my-segment (or even my- as a regex match is executed), then in the above example the promotions will be enabled since the user is identified in my-segment.

Server side

If you're using server side rendering and you need to access the config on the server, make sure to provide the request and response objects. This argument will be ignored on the client side, therefore the following example is an isomorphic example.import React from "react"; import sk from "@stormkit/api"; // Here the `req` and `res` properties are injected somewhere in server entry file. const App = ({ req, res }) => { sk.context({ segment: "my-segment", version: 16 }, req) if (sk.config(req, res).get("Enable promotions") === "true") { return <div>25% discount</div> } return <div>Full price</div> } export default App;