diff --git a/src/sdkManager/__tests__/mocks/output.json b/src/sdkManager/__tests__/mocks/output.json index c96c535f..9fe85c4a 100644 --- a/src/sdkManager/__tests__/mocks/output.json +++ b/src/sdkManager/__tests__/mocks/output.json @@ -6,5 +6,6 @@ "treatments": ["on", "off"], "configs": { "on": "\"color\": \"green\"" - } + }, + "defaultTreatment": "off" } diff --git a/src/sdkManager/index.ts b/src/sdkManager/index.ts index 71dc7716..12e07194 100644 --- a/src/sdkManager/index.ts +++ b/src/sdkManager/index.ts @@ -31,7 +31,8 @@ function objectToView(splitObject: ISplit | null): SplitIO.SplitView | null { killed: splitObject.killed, changeNumber: splitObject.changeNumber || 0, treatments: collectTreatments(splitObject), - configs: splitObject.configurations || {} + configs: splitObject.configurations || {}, + defaultTreatment: splitObject.defaultTreatment }; } diff --git a/src/types.ts b/src/types.ts index 4c215404..786c9121 100644 --- a/src/types.ts +++ b/src/types.ts @@ -610,6 +610,11 @@ export namespace SplitIO { configs: { [treatmentName: string]: string } + /** + * Default treatment value for feature flag. + * @property {string} defaultTreatment + */ + defaultTreatment: string, }; /** * A promise that resolves to a feature flag view.