Skip to content

Commit e784110

Browse files
authored
Version Patch for Firebase Admin (#524)
* Patch the version info and the firebase.SDK_VERSION * [AUTOMATED]: Prettier Code Styling
1 parent b6b4e2f commit e784110

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/database/index.node.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
import firebase from '@firebase/app';
18+
import { CONSTANTS, isNodeSdk } from '@firebase/util';
1819
import { FirebaseApp, FirebaseNamespace } from '@firebase/app-types';
1920
import { _FirebaseNamespace } from '@firebase/app-types/private';
2021
import { Database } from './src/api/Database';
@@ -24,7 +25,6 @@ import { enableLogging } from './src/core/util/util';
2425
import { RepoManager } from './src/core/RepoManager';
2526
import * as INTERNAL from './src/api/internal';
2627
import * as TEST_ACCESS from './src/api/test_access';
27-
import { isNodeSdk } from '@firebase/util';
2828
import './src/nodePatches';
2929
import * as types from '@firebase/database-types';
3030

@@ -38,7 +38,16 @@ import * as types from '@firebase/database-types';
3838

3939
const ServerValue = Database.ServerValue;
4040

41-
export function initStandalone(app, url) {
41+
export function initStandalone(app, url, version?: string) {
42+
/**
43+
* This should allow the firebase-admin package to provide a custom version
44+
* to the backend
45+
*/
46+
CONSTANTS.NODE_ADMIN = true;
47+
if (version) {
48+
firebase.SDK_VERSION = version;
49+
}
50+
4251
return {
4352
instance: RepoManager.getInstance().databaseFromApp(app, url),
4453
namespace: {

0 commit comments

Comments
 (0)