Disclaimer: This website requires JavaScript to function properly. Some features may not work as expected. Please enable JavaScript in your browser settings for the best experience.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

App configuration

Configure the Configured Commerce Mobile SDK.

The Optimizely Configured Commerce Mobile SDK has the following files for configuration:

  • assets/config/base_config.json – Contains all generic values for the app to function properly.
  • assets/config/custom_config.json – Lets you or your partner add any customizations.

lib/features/domain/service/interfaces/app_configuration_service_interface.dart has a member definition for each configuration.

  • BaseConfiguration? get baseConfig; is for base_config.json.
  • CustomConfiguration? get customConfig; is for custom_config.json.

Add values

If you update any values in base_config.json, you can easily access those values at runtime by using IAppConfigurationService.

To incorporate custom logic based on any key included in custom_config.json, regenerate the lib/core/config/custom_configuration.dart file to reflect those new keys. Optimizely recommends using Mason (a code generator CLI tool).

The scripts folder contains some helper scripts. From the root of your project, run sh scripts/mason_installer.sh to install mason. If you have already installed mason, running sh scripts/config_updater.sh when you add a new key should be sufficient. Afterward, you can access those new key and value from anywhere using IAppConfigurationService's customConfig property.