Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 4 additions & 3 deletions packages/remote-config/src/client/rest_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ export class RestClient implements RemoteConfigFetchClient {
this.firebaseInstallations.getToken()
]);

const urlBase =
window.FIREBASE_REMOTE_CONFIG_URL_BASE ||
'https://firebaseremoteconfig.googleapis.com';
let urlBase = 'https://firebaseremoteconfig.googleapis.com';
if (typeof window!== 'undefined' && window.FIREBASE_REMOTE_CONFIG_URL_BASE) {
urlBase = window.FIREBASE_REMOTE_CONFIG_URL_BASE;
}

const url = `${urlBase}/v1/projects/${this.projectId}/namespaces/${this.namespace}:fetch?key=${this.apiKey}`;

Expand Down
4 changes: 4 additions & 0 deletions packages/remote-config/src/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export function registerRemoteConfig(): void {
.getProvider('installations-internal')
.getImmediate();

// Guards against the SDK being used when indexedDB is not available.
if (!isIndexedDBAvailable()) {
throw ERROR_FACTORY.create(ErrorCode.INDEXED_DB_UNAVAILABLE);
}
// Normalizes optional inputs.
const { projectId, apiKey, appId } = app.options;
if (!projectId) {
Expand Down