IBM Cloud Docs
Enable offline mode

Enable offline mode

Benefits of offline mode

Enabling offline mode lets you evaluate feature flags or properties when the application is running in an air-gapped environment.

This method allows the application to use App Configuration SDK and evaluate the feature flags and properties in a highly secure system such as FedRAMP compliant systems. It also helps to achieve GitOps operational procedures, which rely on Git as a source control system.

Creating the configuration file to use in offline mode

To enable offline mode, use a local file with the configuration details. You can create this file by using the App Configuration CLI.

Refer to the CLI reference document for steps to install and configure App Configuration CLI.

Retrieve the configuration in a file by using the command:

ibmcloud ac export [--file FILE]

Command options

--file FILE
Path to file where configuration is exported

Enabling offline mode

As part of App Configuration SDK initialization, you can let the SDK read the configuration from the file.

For a Node.js SDK you can use the local configuration file as in the following example:

const client = AppConfiguration.getInstance();
let region = AppConfiguration.REGION_US_SOUTH;
let guid = 'abc-def-xyz';
let apikey = 'j9qc-abc-z79';
let collectionId = '<collectionId>';
let environmentId = '<environmentId>';

client.init(region, guid, apikey)
client.setContext(collectionId, environmentId, {
    bootstrapFile: "path/to/configuration/file.json",
    liveConfigUpdateEnabled: false
})

For more information, see the respective SDK documentation.