From 2b5ab543dc5de90fe20834fc5e010567452e2ec0 Mon Sep 17 00:00:00 2001 From: tusharkhandelwal8 Date: Mon, 23 Mar 2026 14:09:03 +0530 Subject: [PATCH 1/3] feat(remote-config): add optional exposurePercent field to ExperimentValue --- etc/firebase-admin.remote-config.api.md | 1 + src/remote-config/remote-config-api.ts | 5 +++++ test/unit/remote-config/remote-config.spec.ts | 7 +++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/etc/firebase-admin.remote-config.api.md b/etc/firebase-admin.remote-config.api.md index 1a19d1bb6c..670fecb5aa 100644 --- a/etc/firebase-admin.remote-config.api.md +++ b/etc/firebase-admin.remote-config.api.md @@ -56,6 +56,7 @@ export interface ExperimentParameterValue { export interface ExperimentValue { experimentId: string; variantValue: ExperimentVariantValue[]; + exposurePercent?: number; } // @public diff --git a/src/remote-config/remote-config-api.ts b/src/remote-config/remote-config-api.ts index 6566fe231e..9827adbf43 100644 --- a/src/remote-config/remote-config-api.ts +++ b/src/remote-config/remote-config-api.ts @@ -451,6 +451,11 @@ export interface ExperimentValue { * served by the Experiment. */ variantValue: ExperimentVariantValue[]; + + /** + * The percentage of users included in the Experiment. + */ + exposurePercent?: number; } /** diff --git a/test/unit/remote-config/remote-config.spec.ts b/test/unit/remote-config/remote-config.spec.ts index 74d277290e..a4c04119cc 100644 --- a/test/unit/remote-config/remote-config.spec.ts +++ b/test/unit/remote-config/remote-config.spec.ts @@ -134,7 +134,8 @@ describe('RemoteConfig', () => { variantValue: [ { variantId: 'variant_A', value: 'true' }, { variantId: 'variant_B', noChange: true } - ] + ], + exposurePercent: 25, } } }, @@ -233,7 +234,8 @@ describe('RemoteConfig', () => { variantValue: [ { variantId: 'variant_A', value: 'true' }, { variantId: 'variant_B', noChange: true } - ] + ], + exposurePercent: 25, } } }, @@ -652,6 +654,7 @@ describe('RemoteConfig', () => { expect(p4.conditionalValues).to.not.be.undefined; const experimentParam = p4.conditionalValues!['ios'] as ExperimentParameterValue; expect(experimentParam.experimentValue.experimentId).to.equal('experiment_1'); + expect(experimentParam.experimentValue.exposurePercent).to.equal(25); expect(experimentParam.experimentValue.variantValue.length).to.equal(2); expect(experimentParam.experimentValue.variantValue[0]).to.deep.equal({ variantId: 'variant_A', value: 'true' }); expect(experimentParam.experimentValue.variantValue[1]).to.deep.equal({ variantId: 'variant_B', noChange: true }); From 55fc2b1bd7602ece6aa0ccf4cf721d60bdb05b34 Mon Sep 17 00:00:00 2001 From: tusharkhandelwal8 Date: Mon, 23 Mar 2026 14:21:06 +0530 Subject: [PATCH 2/3] document the expected range for the exposure --- src/remote-config/remote-config-api.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/remote-config/remote-config-api.ts b/src/remote-config/remote-config-api.ts index 9827adbf43..0f2648d797 100644 --- a/src/remote-config/remote-config-api.ts +++ b/src/remote-config/remote-config-api.ts @@ -453,7 +453,8 @@ export interface ExperimentValue { variantValue: ExperimentVariantValue[]; /** - * The percentage of users included in the Experiment. + * The percentage of users included in the Experiment, represented as a number + * between 0 and 100. */ exposurePercent?: number; } From 50392c76a8d4e3fbb829fd67aa05e3a0f959695f Mon Sep 17 00:00:00 2001 From: tusharkhandelwal8 Date: Mon, 23 Mar 2026 14:29:05 +0530 Subject: [PATCH 3/3] correct field ordering in ExperimentValue API report --- etc/firebase-admin.remote-config.api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/firebase-admin.remote-config.api.md b/etc/firebase-admin.remote-config.api.md index 670fecb5aa..675fdf54a3 100644 --- a/etc/firebase-admin.remote-config.api.md +++ b/etc/firebase-admin.remote-config.api.md @@ -55,8 +55,8 @@ export interface ExperimentParameterValue { // @public export interface ExperimentValue { experimentId: string; - variantValue: ExperimentVariantValue[]; exposurePercent?: number; + variantValue: ExperimentVariantValue[]; } // @public