File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,28 @@ import * as TEST_ACCESS from './src/api/test_access';
25
25
import { isNodeSdk } from '@firebase/util' ;
26
26
import './src/nodePatches' ;
27
27
28
+ /**
29
+ * A one off register function which returns a database based on the app and
30
+ * passed database URL.
31
+ *
32
+ * @param app A valid FirebaseApp-like object
33
+ * @param url A valid Firebase databaseURL
34
+ */
35
+ export function initStandalone ( app , url ) {
36
+ return {
37
+ instance : RepoManager . getInstance ( ) . databaseFromApp ( app , url ) ,
38
+ namespace : {
39
+ Reference,
40
+ Query,
41
+ Database,
42
+ enableLogging,
43
+ INTERNAL ,
44
+ ServerValue : Database . ServerValue ,
45
+ TEST_ACCESS
46
+ }
47
+ } ;
48
+ }
49
+
28
50
export function registerDatabase ( instance : FirebaseNamespace ) {
29
51
// Register the Database Service with the 'firebase' namespace.
30
52
const namespace = instance . INTERNAL . registerService (
@@ -45,7 +67,7 @@ export function registerDatabase(instance: FirebaseNamespace) {
45
67
) ;
46
68
47
69
if ( isNodeSdk ( ) ) {
48
- module . exports = namespace ;
70
+ module . exports = Object . assign ( { } , namespace , { initStandalone } ) ;
49
71
}
50
72
}
51
73
You can’t perform that action at this time.
0 commit comments