Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions etc/firebase-admin.remote-config.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface ExperimentParameterValue {
export interface ExperimentValue {
experimentId: string;
variantValue: ExperimentVariantValue[];
exposurePercent?: number;
}

// @public
Expand Down
5 changes: 5 additions & 0 deletions src/remote-config/remote-config-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ export interface ExperimentValue {
* served by the Experiment.
*/
variantValue: ExperimentVariantValue[];

/**
* The percentage of users included in the Experiment.
*/
exposurePercent?: number;
Comment thread
tusharkhandelwal8 marked this conversation as resolved.
Comment thread
tusharkhandelwal8 marked this conversation as resolved.
}

/**
Expand Down
7 changes: 5 additions & 2 deletions test/unit/remote-config/remote-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ describe('RemoteConfig', () => {
variantValue: [
{ variantId: 'variant_A', value: 'true' },
{ variantId: 'variant_B', noChange: true }
]
],
exposurePercent: 25,
}
}
},
Expand Down Expand Up @@ -233,7 +234,8 @@ describe('RemoteConfig', () => {
variantValue: [
{ variantId: 'variant_A', value: 'true' },
{ variantId: 'variant_B', noChange: true }
]
],
exposurePercent: 25,
}
}
},
Expand Down Expand Up @@ -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 });
Expand Down
Loading