Getting All Variables
Overview
This article serves to explain how to use the SDKs to retrieve all Variables for the user.
Using Get All Variables
The "Get All Variables" function in an SDK will return a map of all of the Variables that the user has received from the DevCycle server based on the information the SDK or API has received.
The response is the following general format, with slight changes depending on the specifics of the SDK:
{
"my-feature-variable": {
"_id": "617c19199db63239d2d17025",
"key": "my-feature-variable",
"type": "Boolean",
"value": false
},
"some-string-variable": {
"_id": "61828f25c1c23bc6ae1366e9",
"key": "some-string-variable",
"type": "String",
"value": "this is a string variable value"
},
Only Variables in Features that the user has been successfully targeted for will be part of the response to this SDK. Targeting rules must be enabled for the environment this SDK is being called on.
Features within the Project that have rules disabled OR the user is not Targeted for will not have their variables appear in the response of this function.
Client-Side SDK Usage
• JavaScript SDK
• React SDK
The DevCycle React SDK is built upon the JavaScript SDK. For more details, view the JavaScript SDK documentation