UNPKG

voluptasmollitia

Version:
49 lines (27 loc) 1.13 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@firebase/app](./app.md) &gt; [getApp](./app.getapp.md) ## getApp() function Retrieves a FirebaseApp instance. When called with no arguments, the default app is returned. When an app name is provided, the app corresponding to that name is returned. An exception is thrown if the app being retrieved has not yet been initialized. <b>Signature:</b> ```typescript export declare function getApp(name?: string): FirebaseApp; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | name | string | Optional name of the app to return. If no name is provided, the default is <code>&quot;[DEFAULT]&quot;</code>. | <b>Returns:</b> [FirebaseApp](./app.firebaseapp.md) The app corresponding to the provided app name. If no app name is provided, the default app is returned. ## Example 1 ```javascript // Return the default app const app = getApp(); ``` ## Example 2 ```javascript // Return a named app const otherApp = getApp("otherApp"); ```