@firebase/remote-config 0.7.0 → 0.8.0-20260114160934
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.esm.js +85 -6
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/src/abt/experiment.d.ts +13 -0
- package/dist/esm/src/errors.d.ts +5 -1
- package/dist/esm/src/public_types.d.ts +19 -0
- package/dist/esm/src/remote_config.d.ts +11 -1
- package/dist/esm/src/storage/storage.d.ts +3 -1
- package/dist/index.cjs.js +85 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/remote-config-public.d.ts +20 -0
- package/dist/remote-config.d.ts +20 -0
- package/dist/src/abt/experiment.d.ts +13 -0
- package/dist/src/errors.d.ts +5 -1
- package/dist/src/global_index.d.ts +20 -1
- package/dist/src/public_types.d.ts +19 -0
- package/dist/src/remote_config.d.ts +11 -1
- package/dist/src/storage/storage.d.ts +3 -1
- package/package.json +2 -2
|
@@ -136,6 +136,12 @@ export declare interface FetchResponse {
|
|
|
136
136
|
* The version number of the config template fetched from the server.
|
|
137
137
|
*/
|
|
138
138
|
templateVersion?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Metadata for A/B testing and Remote Config Rollout experiments.
|
|
141
|
+
*
|
|
142
|
+
* @remarks Only defined for 200 responses.
|
|
143
|
+
*/
|
|
144
|
+
experiments?: FirebaseExperimentDescription[];
|
|
139
145
|
}
|
|
140
146
|
|
|
141
147
|
/**
|
|
@@ -165,6 +171,20 @@ export declare type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'thro
|
|
|
165
171
|
*/
|
|
166
172
|
export declare type FetchType = 'BASE' | 'REALTIME';
|
|
167
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Defines experiment and variant attached to a config parameter.
|
|
176
|
+
*
|
|
177
|
+
* @public
|
|
178
|
+
*/
|
|
179
|
+
export declare interface FirebaseExperimentDescription {
|
|
180
|
+
experimentId: string;
|
|
181
|
+
variantId: string;
|
|
182
|
+
experimentStartTime: string;
|
|
183
|
+
triggerTimeoutMillis: string;
|
|
184
|
+
timeToLiveMillis: string;
|
|
185
|
+
affectedParameterKeys?: string[];
|
|
186
|
+
}
|
|
187
|
+
|
|
168
188
|
/**
|
|
169
189
|
* Defines a self-descriptive reference for config key-value pairs.
|
|
170
190
|
*
|
package/dist/remote-config.d.ts
CHANGED
|
@@ -136,6 +136,12 @@ export declare interface FetchResponse {
|
|
|
136
136
|
* The version number of the config template fetched from the server.
|
|
137
137
|
*/
|
|
138
138
|
templateVersion?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Metadata for A/B testing and Remote Config Rollout experiments.
|
|
141
|
+
*
|
|
142
|
+
* @remarks Only defined for 200 responses.
|
|
143
|
+
*/
|
|
144
|
+
experiments?: FirebaseExperimentDescription[];
|
|
139
145
|
}
|
|
140
146
|
|
|
141
147
|
/**
|
|
@@ -165,6 +171,20 @@ export declare type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'thro
|
|
|
165
171
|
*/
|
|
166
172
|
export declare type FetchType = 'BASE' | 'REALTIME';
|
|
167
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Defines experiment and variant attached to a config parameter.
|
|
176
|
+
*
|
|
177
|
+
* @public
|
|
178
|
+
*/
|
|
179
|
+
export declare interface FirebaseExperimentDescription {
|
|
180
|
+
experimentId: string;
|
|
181
|
+
variantId: string;
|
|
182
|
+
experimentStartTime: string;
|
|
183
|
+
triggerTimeoutMillis: string;
|
|
184
|
+
timeToLiveMillis: string;
|
|
185
|
+
affectedParameterKeys?: string[];
|
|
186
|
+
}
|
|
187
|
+
|
|
168
188
|
/**
|
|
169
189
|
* Defines a self-descriptive reference for config key-value pairs.
|
|
170
190
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FirebaseExperimentDescription } from '../public_types';
|
|
2
|
+
import { RemoteConfig } from '../remote_config';
|
|
3
|
+
export declare class Experiment {
|
|
4
|
+
private storage;
|
|
5
|
+
private logger;
|
|
6
|
+
private analyticsProvider;
|
|
7
|
+
constructor(rc: RemoteConfig);
|
|
8
|
+
updateActiveExperiments(latestExperiments: FirebaseExperimentDescription[]): Promise<void>;
|
|
9
|
+
private createExperimentInfoMap;
|
|
10
|
+
private addActiveExperiments;
|
|
11
|
+
private removeInactiveExperiments;
|
|
12
|
+
private addExperimentToAnalytics;
|
|
13
|
+
}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -35,7 +35,8 @@ export declare const enum ErrorCode {
|
|
|
35
35
|
CONFIG_UPDATE_STREAM_ERROR = "stream-error",
|
|
36
36
|
CONFIG_UPDATE_UNAVAILABLE = "realtime-unavailable",
|
|
37
37
|
CONFIG_UPDATE_MESSAGE_INVALID = "update-message-invalid",
|
|
38
|
-
CONFIG_UPDATE_NOT_FETCHED = "update-not-fetched"
|
|
38
|
+
CONFIG_UPDATE_NOT_FETCHED = "update-not-fetched",
|
|
39
|
+
ANALYTICS_UNAVAILABLE = "analytics-unavailable"
|
|
39
40
|
}
|
|
40
41
|
interface ErrorParams {
|
|
41
42
|
[ErrorCode.STORAGE_OPEN]: {
|
|
@@ -77,6 +78,9 @@ interface ErrorParams {
|
|
|
77
78
|
[ErrorCode.CONFIG_UPDATE_NOT_FETCHED]: {
|
|
78
79
|
originalErrorMessage: string;
|
|
79
80
|
};
|
|
81
|
+
[ErrorCode.ANALYTICS_UNAVAILABLE]: {
|
|
82
|
+
originalErrorMessage: string;
|
|
83
|
+
};
|
|
80
84
|
}
|
|
81
85
|
export declare const ERROR_FACTORY: ErrorFactory<ErrorCode, ErrorParams>;
|
|
82
86
|
export declare function hasErrorCode(e: Error, errorCode: ErrorCode): boolean;
|
|
@@ -255,6 +255,19 @@ interface RemoteConfig {
|
|
|
255
255
|
interface FirebaseRemoteConfigObject {
|
|
256
256
|
[key: string]: string;
|
|
257
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* Defines experiment and variant attached to a config parameter.
|
|
260
|
+
*
|
|
261
|
+
* @public
|
|
262
|
+
*/
|
|
263
|
+
interface FirebaseExperimentDescription {
|
|
264
|
+
experimentId: string;
|
|
265
|
+
variantId: string;
|
|
266
|
+
experimentStartTime: string;
|
|
267
|
+
triggerTimeoutMillis: string;
|
|
268
|
+
timeToLiveMillis: string;
|
|
269
|
+
affectedParameterKeys?: string[];
|
|
270
|
+
}
|
|
258
271
|
/**
|
|
259
272
|
* Defines a successful response (200 or 304).
|
|
260
273
|
*
|
|
@@ -291,6 +304,12 @@ interface FetchResponse {
|
|
|
291
304
|
* The version number of the config template fetched from the server.
|
|
292
305
|
*/
|
|
293
306
|
templateVersion?: number;
|
|
307
|
+
/**
|
|
308
|
+
* Metadata for A/B testing and Remote Config Rollout experiments.
|
|
309
|
+
*
|
|
310
|
+
* @remarks Only defined for 200 responses.
|
|
311
|
+
*/
|
|
312
|
+
experiments?: FirebaseExperimentDescription[];
|
|
294
313
|
}
|
|
295
314
|
/**
|
|
296
315
|
* Options for Remote Config initialization.
|
|
@@ -652,4 +671,4 @@ declare global {
|
|
|
652
671
|
}
|
|
653
672
|
}
|
|
654
673
|
|
|
655
|
-
export { ConfigUpdate, ConfigUpdateObserver, CustomSignals, FetchResponse, FetchStatus, FetchType, FirebaseRemoteConfigObject, LogLevel, RemoteConfig, RemoteConfigOptions, RemoteConfigSettings, Unsubscribe, Value, ValueSource, activate, ensureInitialized, fetchAndActivate, fetchConfig, getAll, getBoolean, getNumber, getRemoteConfig, getString, getValue, isSupported, onConfigUpdate, setCustomSignals, setLogLevel };
|
|
674
|
+
export { ConfigUpdate, ConfigUpdateObserver, CustomSignals, FetchResponse, FetchStatus, FetchType, FirebaseExperimentDescription, FirebaseRemoteConfigObject, LogLevel, RemoteConfig, RemoteConfigOptions, RemoteConfigSettings, Unsubscribe, Value, ValueSource, activate, ensureInitialized, fetchAndActivate, fetchConfig, getAll, getBoolean, getNumber, getRemoteConfig, getString, getValue, isSupported, onConfigUpdate, setCustomSignals, setLogLevel };
|
|
@@ -54,6 +54,19 @@ export interface RemoteConfig {
|
|
|
54
54
|
export interface FirebaseRemoteConfigObject {
|
|
55
55
|
[key: string]: string;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Defines experiment and variant attached to a config parameter.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export interface FirebaseExperimentDescription {
|
|
63
|
+
experimentId: string;
|
|
64
|
+
variantId: string;
|
|
65
|
+
experimentStartTime: string;
|
|
66
|
+
triggerTimeoutMillis: string;
|
|
67
|
+
timeToLiveMillis: string;
|
|
68
|
+
affectedParameterKeys?: string[];
|
|
69
|
+
}
|
|
57
70
|
/**
|
|
58
71
|
* Defines a successful response (200 or 304).
|
|
59
72
|
*
|
|
@@ -90,6 +103,12 @@ export interface FetchResponse {
|
|
|
90
103
|
* The version number of the config template fetched from the server.
|
|
91
104
|
*/
|
|
92
105
|
templateVersion?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Metadata for A/B testing and Remote Config Rollout experiments.
|
|
108
|
+
*
|
|
109
|
+
* @remarks Only defined for 200 responses.
|
|
110
|
+
*/
|
|
111
|
+
experiments?: FirebaseExperimentDescription[];
|
|
93
112
|
}
|
|
94
113
|
/**
|
|
95
114
|
* Options for Remote Config initialization.
|
|
@@ -20,6 +20,8 @@ import { StorageCache } from './storage/storage_cache';
|
|
|
20
20
|
import { RemoteConfigFetchClient } from './client/remote_config_fetch_client';
|
|
21
21
|
import { Storage } from './storage/storage';
|
|
22
22
|
import { Logger } from '@firebase/logger';
|
|
23
|
+
import { FirebaseAnalyticsInternalName } from '@firebase/analytics-interop-types';
|
|
24
|
+
import { Provider } from '@firebase/component';
|
|
23
25
|
import { RealtimeHandler } from './client/realtime_handler';
|
|
24
26
|
/**
|
|
25
27
|
* Encapsulates business logic mapping network and storage dependencies to the public SDK API.
|
|
@@ -48,6 +50,10 @@ export declare class RemoteConfig implements RemoteConfigType {
|
|
|
48
50
|
* @internal
|
|
49
51
|
*/
|
|
50
52
|
readonly _realtimeHandler: RealtimeHandler;
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
readonly _analyticsProvider: Provider<FirebaseAnalyticsInternalName>;
|
|
51
57
|
/**
|
|
52
58
|
* Tracks completion of initialization promise.
|
|
53
59
|
* @internal
|
|
@@ -84,5 +90,9 @@ export declare class RemoteConfig implements RemoteConfigType {
|
|
|
84
90
|
/**
|
|
85
91
|
* @internal
|
|
86
92
|
*/
|
|
87
|
-
_realtimeHandler: RealtimeHandler
|
|
93
|
+
_realtimeHandler: RealtimeHandler,
|
|
94
|
+
/**
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
_analyticsProvider: Provider<FirebaseAnalyticsInternalName>);
|
|
88
98
|
}
|
|
@@ -43,7 +43,7 @@ export interface RealtimeBackoffMetadata {
|
|
|
43
43
|
*
|
|
44
44
|
* <p>This seems like a small price to avoid potentially subtle bugs caused by a typo.
|
|
45
45
|
*/
|
|
46
|
-
type ProjectNamespaceKeyFieldValue = 'active_config' | 'active_config_etag' | 'last_fetch_status' | 'last_successful_fetch_timestamp_millis' | 'last_successful_fetch_response' | 'settings' | 'throttle_metadata' | 'custom_signals' | 'realtime_backoff_metadata' | 'last_known_template_version';
|
|
46
|
+
type ProjectNamespaceKeyFieldValue = 'active_config' | 'active_config_etag' | 'active_experiments' | 'last_fetch_status' | 'last_successful_fetch_timestamp_millis' | 'last_successful_fetch_response' | 'settings' | 'throttle_metadata' | 'custom_signals' | 'realtime_backoff_metadata' | 'last_known_template_version';
|
|
47
47
|
export declare function openDatabase(): Promise<IDBDatabase>;
|
|
48
48
|
/**
|
|
49
49
|
* Abstracts data persistence.
|
|
@@ -59,6 +59,8 @@ export declare abstract class Storage {
|
|
|
59
59
|
setActiveConfig(config: FirebaseRemoteConfigObject): Promise<void>;
|
|
60
60
|
getActiveConfigEtag(): Promise<string | undefined>;
|
|
61
61
|
setActiveConfigEtag(etag: string): Promise<void>;
|
|
62
|
+
getActiveExperiments(): Promise<Set<string> | undefined>;
|
|
63
|
+
setActiveExperiments(experiments: Set<string>): Promise<void>;
|
|
62
64
|
getThrottleMetadata(): Promise<ThrottleMetadata | undefined>;
|
|
63
65
|
setThrottleMetadata(metadata: ThrottleMetadata): Promise<void>;
|
|
64
66
|
deleteThrottleMetadata(): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/remote-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-20260114160934",
|
|
4
4
|
"description": "The Remote Config package of the Firebase JS SDK",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"license": "Apache-2.0",
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@firebase/app": "0.14.
|
|
51
|
+
"@firebase/app": "0.14.6",
|
|
52
52
|
"rollup": "2.79.2",
|
|
53
53
|
"rollup-plugin-dts": "5.3.1",
|
|
54
54
|
"rollup-plugin-typescript2": "0.36.0",
|