Creating configuration values
|
Creating and using a configuration value using CloudBees Feature Management is simple. As soon as you define a configuration value in code and build and run your application, the newly defined configuration value will appear in the dashboard.
1. Creating a container class
To create your first configuration value, you should do the following:
-
Create a container class for your configuration.
-
Define a configuration value inside the container class by picking the name, default value, and type.
Here are example code snippets:
Swift | Objective-C | Android | React Native | JavaScript | Node.js | JavaScript SSR |
---|---|---|---|---|---|---|
|
|
|
|
|
|
|
Containers can have flags and configurations! Containers can have both flags and configuration values—it’s simply a matter of taste. |
2. Registering the container class
Once you have the container class defined, you need to register the instance to the
CloudBees Feature Management SDK. This is done with the register
SDK function.
The register
function accepts an instance of the Container
class.
Swift | Objective-C | Android | React Native | Javascript | Node.js | JavaScript SSR |
---|---|---|---|---|---|---|
|
|
|
|
|
|
|
3. Using the configuration values
The last thing you need to do is use the configuration value in your code.
Here’s an example:
Swift | Objective-C | Android | React Native | Javascript | Node.js | JavaScript SSR |
---|---|---|---|---|---|---|
|
|
|
|
|
|
|