Setting FaceTec Feature Flags

Use this page to learn how to set FaceTec Feature Flags, which enable or change certain behaviors of the FaceTec SDKs.


Android SDK

In the Android SDK, you can set a Feature Flag by using the FaceTecCustomization class, as shown below:

// Create feature flags map and add values
HashMap<String, String> featureFlags = new HashMap<>();
featureFlags.put("<FEATURE_FLAG_KEY>", "<FEATURE_FLAG_VALUE>");

// Create FaceTecCustomization instance using the optional feature flag parameter
FaceTecCustomization customization = new FaceTecCustomization(featureFlags);

// Set the customization instance for the SDK
FaceTecSDK.setCustomization(customization);
Important Note: In the FaceTec Android SDK, Feature Flags can be updated and changed between FaceTec Sessions. When a new FaceTec Session is started, the Feature Flags defined in the last call of FaceTecSDK.setCustomization() will be applied.

iOS SDK

In the iOS SDK, you can set a Feature Flag by using the FaceTecCustomization class, as shown below:

// Create feature flags map and add values
var featureFlagsMap = [String: String]()
featureFlagsMap["<FEATURE_FLAG_KEY>"] = "<FEATURE_FLAG_VALUE>"

// Create FaceTecCustomization instance using the optional feature flag parameter
let customization = FaceTecCustomization(featureFlagsMap: featureFlagsMap)

// Set the customization instance for the SDK
FaceTec.sdk.setCustomization(customization)
Important Note: In the FaceTec iOS SDK, Feature Flags can be updated and changed between FaceTec Sessions. When a new FaceTec Session is started, the Feature Flags defined in the last call of FaceTec.sdk.setCustomization() will be applied.

Browser SDK

In the Browser SDK, you can set a Feature Flag by using the FaceTecCustomization class, as shown below:

// Create feature flags object array
var featureFlags = [ { <FEATURE_FLAG_KEY>: "<FEATURE_FLAG_VALUE>" } ];

// Create FaceTecCustomization instance using the optional feature flag parameter
var customization: FaceTecCustomization = new FaceTecSDK.FaceTecCustomization(featureFlags);

// Set the customization instance for the SDK
FaceTecSDK.setCustomization(customization);
Important Note: In the FaceTec Browser SDK, Feature Flags can be updated and changed between FaceTec Sessions. When a new FaceTec Session is started, the Feature Flags defined in the last call of FaceTecSDK.setCustomization() will be applied.

FaceTec Server

There are two methods available for specifying Feature Flags in the FaceTec Server. Both of these methods produce the same results.

Method 1 (with config.yaml):

Feature Flags can be set in the config.yaml file, as shown below:

# Add any feature flags
featureFlags:
  featureFlagKey_A: 3ac556a9-15ae-4baf-8a91-a00aa40c0c2c
  featureFlagKey_B: b67993d9-f7f8-4df0-8ee5-6180200a3d25

Method 2 (with Java Class Changes):

Feature Flags can also be set in FaceTecInstanceManager.java, as shown below:

// Create a Hashmap and add your feature flags
HashMap<String, String> featureFlags = new HashMap<>();
featureFlags.put("featureFlagKey_A", "3ac556a9-15ae-4baf-8a91-a00aa40c0c2c");
featureFlags.put("featureFlagKey_B", "b67993d9-f7f8-4df0-8ee5-6180200a3d25");

// Set the feature flag property on you FaceTecInitializeConfig object and pass that into the init method
FaceTecInitializeConfig faceTecInitializeConfig = new FaceTecInitializeConfig();
faceTecInitializeConfig.featureFlags = featureFlags;
FaceTecSDKInstance = FaceTecSDK.initializeInProductionModeWithServer(config.usageLogServerUri, config.deviceKeyIdentifier, config.serverKey, config.faceMapEncryptionKey, faceTecInitializeConfig);