Skip to content

Commit 04af931

Browse files
authored
Remove the new FirebaseServerApp from the app-types.
Remove the new FirebaseServerApp from the app-types. App-types are meant only for compat, and FirebaseServerApp will not be part of compat.
1 parent 4aeb9a6 commit 04af931

File tree

3 files changed

+7
-182
lines changed

3 files changed

+7
-182
lines changed

docs-devsite/app.firebaseserverappsettings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# FirebaseServerAppSettings interface
13-
Configuration options given to [initializeServerApp()](./app.md#initializeserverapp)
13+
Configuration options given to [initializeServerApp()](./app.md#initializeserverapp_30ab697)
1414

1515
<b>Signature:</b>
1616

@@ -26,7 +26,7 @@ export interface FirebaseServerAppSettings extends FirebaseAppSettings
2626
| [appCheckToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsappchecktoken) | string | An optional AppCheck token.<!-- -->If provided, the FirebaseServerApp instance will work to validate the token. The result of the validation can be monitored by invoking the FirebaseServerApp.appCheckTokenVerified(). Awaiting the Promise returned by appCheckTokenVerified is highly recommended if an AppCheck token is provided.<!-- -->If the token has been properly verified then the AppCheck token will be automatically used by Firebase SDKs that support App Check.<!-- -->If the token fails verification then a warning is logged and the token will not be used. |
2727
| [authIdToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsauthidtoken) | string | An optional Auth ID token used to resume a signed in user session from a client runtime environment.<!-- -->If provided, the FirebaseServerApp instance will work to validate the token. The result of the validation can be queried via by the application by invoking the FirebaseServerApp.authIdTokenVerified(). Awaiting the Promise returned by authIdTokenVerified is highly recommended if an Auth ID token is provided.<!-- -->Once the token has been properly verified then invoking getAuth() will attempt to automatically sign in a user with the provided Auth ID Token.<!-- -->If the token fails verification then a warning is logged and Auth SDK will not attempt to sign in a user upon its initalization. |
2828
| [installationsAuthToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsinstallationsauthtoken) | string | An optional Installation Auth token.<!-- -->If provided, the FirebaseServerApp instance will work to validate the token. The result of the validation can be monitored by invoking the FirebaseServerApp.installationTokenVerified(). Awaiting the Promise returned by appCheckTokenVerified is highly recommended before initalization any other Firebase SDKs.<!-- -->If the token has been properly verified then the Installation Auth token will be automatically used by Firebase SDKs that support Firebase Installations.<!-- -->If the token fails verification then a warning is logged and the token will not be used. |
29-
| [name](./app.firebaseserverappsettings.md#firebaseserverappsettingsname) | "" | There is no get for FirebaseServerApps, so the name is not relevant. however it's always a blank string so that FirebaseServerApp conforms to the FirebaseApp interface declaration. |
29+
| [name](./app.firebaseserverappsettings.md#firebaseserverappsettingsname) | undefined | There is no get for FirebaseServerApps, so the name is not relevant. however it's always a blank string so that FirebaseServerApp conforms to the FirebaseApp interface declaration. |
3030
| [releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) | object | An optional object. If provided, the Firebase SDK will use a FinalizationRegistry object to monitor the Garbage Collection status of the provided object, and the Firebase SDK will release its refrence on the FirebaseServerApp instance when the provided object is collected. or.<!-- -->The intent of this field is to help reduce memory overhead for long-running cloud functions executing SSR fulfillment without the customer's app needing to orchestrate FirebaseServerApp cleanup. Additionally, prexisting FirebaseServerApp instances may reused if they're identical to a previously generated one that has yet to be deleted.<!-- -->If the object is not provided then the application must clean up the FirebaseServerApp instance through the applicationss own standard mechanisms by invoking deleteApp.<!-- -->If the app provides an object in this parameter, but the application is executed in a JavaScript engine that predates the support of FinalizationRegistry (introduced in node v14.6.0, for instance), then the Firebase SDK will not be able to automatically clean up the FirebaseServerApp instance and an error will be thrown. |
3131
3232
## FirebaseServerAppSettings.appCheckToken
@@ -84,7 +84,7 @@ There is no get for FirebaseServerApps, so the name is not relevant. however it'
8484
<b>Signature:</b>
8585
8686
```typescript
87-
name?: "";
87+
name?: undefined;
8888
```
8989
9090
## FirebaseServerAppSettings.releaseOnDeref

docs-devsite/app.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ This package coordinates the communication between the different Firebase compon
3434
| <b>function(options, ...)</b> |
3535
| [initializeApp(options, name)](./app.md#initializeapp_cb2f5e1) | Creates and initializes a [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance.<!-- -->See [Add Firebase to your app](https://firebase.google.com/docs/web/setup#add_firebase_to_your_app) and [Initialize multiple projects](https://firebase.google.com/docs/web/setup#multiple-projects) for detailed documentation. |
3636
| [initializeApp(options, config)](./app.md#initializeapp_079e917) | Creates and initializes a FirebaseApp instance. |
37+
| [initializeServerApp(options, config)](./app.md#initializeserverapp_30ab697) | Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance.<!-- -->The FirebaseServerApp is similar to FirebaseApp, but is intended for execution in server side rendering environments only.<!-- -->See [Add Firebase to your app](https://firebase.google.com/docs/web/setup#add_firebase_to_your_app) and [Initialize multiple projects](https://firebase.google.com/docs/web/setup#multiple-projects) for detailed documentation. |
3738

3839
## Interfaces
3940

@@ -43,7 +44,7 @@ This package coordinates the communication between the different Firebase compon
4344
| [FirebaseAppSettings](./app.firebaseappsettings.md#firebaseappsettings_interface) | Configuration options given to [initializeApp()](./app.md#initializeapp_cb2f5e1) |
4445
| [FirebaseOptions](./app.firebaseoptions.md#firebaseoptions_interface) | Firebase configuration object. Contains a set of parameters required by services in order to successfully communicate with Firebase server APIs and to associate client data with your Firebase project and Firebase application. Typically this object is populated by the Firebase console at project setup. See also: [Learn about the Firebase config object](https://firebase.google.com/docs/web/setup#config-object)<!-- -->. |
4546
| [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) | A [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) holds the initialization information for a collection of services running in server enviornments.<!-- -->Do not call this constructor directly. Instead, use to create an app. |
46-
| [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | Configuration options given to [initializeServerApp()](./app.md#initializeserverapp) |
47+
| [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | Configuration options given to [initializeServerApp()](./app.md#initializeserverapp_30ab697) |
4748

4849
## Variables
4950

@@ -312,7 +313,7 @@ export declare function initializeApp(options: FirebaseOptions, config?: Firebas
312313

313314
[FirebaseApp](./app.firebaseapp.md#firebaseapp_interface)
314315

315-
## initializeServerApp()
316+
### initializeServerApp(options, config) {:#initializeserverapp_30ab697}
316317

317318
Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance.
318319

@@ -326,7 +327,7 @@ See [Add Firebase to your app](https://firebase.google.com/docs/web/setup#add_fi
326327
export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config: FirebaseServerAppSettings): FirebaseServerApp;
327328
```
328329

329-
### Parameters
330+
#### Parameters
330331

331332
| Parameter | Type | Description |
332333
| --- | --- | --- |

packages/app-types/index.d.ts

Lines changed: 0 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -32,84 +32,6 @@ export interface FirebaseAppConfig {
3232
automaticDataCollectionEnabled?: boolean;
3333
}
3434

35-
export interface FirebaseServerAppConfig extends FirebaseAppConfig {
36-
/**
37-
* An optional Auth ID token used to resume a signed in user session from a client
38-
* runtime environment.
39-
*
40-
* If provided, the FirebaseServerApp instance will work to validate the token. The
41-
* result of the validation can be queried via by the application by invoking the
42-
* FirebaseServerApp.authIdTokenVerified(). Awaiting the Promise returned by
43-
* authIdTokenVerified is highly recommended if an Auth ID token is provided.
44-
*
45-
* Once the token has been properly verified then invoking getAuth() will attempt to
46-
* automatically sign in a user with the provided Auth ID Token.
47-
*
48-
* If the token fails verification then a warning is logged and Auth SDK will not
49-
* attempt to sign in a user upon its initalization.
50-
*/
51-
authIdToken?: string;
52-
53-
/**
54-
* An optional AppCheck token.
55-
*
56-
* If provided, the FirebaseServerApp instance will work to validate the token. The
57-
* result of the validation can be monitored by invoking the
58-
* FirebaseServerApp.appCheckTokenVerified(). Awaiting the Promise returned by
59-
* appCheckTokenVerified is highly recommended if an AppCheck token is provided.
60-
*
61-
* If the token has been properly verified then the AppCheck token will be
62-
* automatically used by Firebase SDKs that support App Check.
63-
*
64-
* If the token fails verification then a warning is logged and the token will not
65-
* be used.
66-
*/
67-
appCheckToken?: string;
68-
69-
/**
70-
* An optional Installation Auth token.
71-
*
72-
* If provided, the FirebaseServerApp instance will work to validate the token. The
73-
* result of the validation can be monitored by invoking the
74-
* FirebaseServerApp.installationAuthTokenVerified(). Awaiting the Promise returned by
75-
* appCheckTokenVerified is highly recommended before initalization any other Firebase
76-
* SDKs.
77-
*
78-
* If the token has been properly verified then the Installation Auth token will be
79-
* automatically used by Firebase SDKs that support Firebase Installations.
80-
*
81-
* If the token fails verification then a warning is logged and the token will not
82-
* be used.
83-
*/
84-
installationAuthToken?: string;
85-
86-
/**
87-
* An optional object. If provided, the Firebase SDK will use a FinalizationRegistry
88-
* object to monitor its GC status. The Firebase SDK will cleanup and
89-
* delete the corresponding FirebaseServerApp instance when the provided object is
90-
* deleted by the garbage collector.
91-
*
92-
* The intent of this field is to help reduce memory overhead for long-running cloud
93-
* functions executing SSR fulfillment without the customer's app needing to
94-
* orchestrate FirebaseServerApp cleanup.
95-
*
96-
* For instance, in the case that asynchronous operations makes it difficult to
97-
* determine the finality of the server side rendering pass.
98-
*
99-
* If the object is not provided then the application must clean up the
100-
* FirebaseServerApp instance through it's own standard mechanisms by invoking
101-
* deleteApp.
102-
*
103-
* If the app uses provides an object but uses a JavaScript engine that predates the
104-
* support of FinalizationRegistry (introduced in node v14.6.0, for instance), then the
105-
* Firebase SDK will not be able to automatically clean up the FirebaseServerApp
106-
* instance and an error will be thrown.
107-
*/
108-
deleteOnDeref?: object;
109-
110-
name: undefined;
111-
}
112-
11335
export class FirebaseApp {
11436
/**
11537
* The (read-only) name (identifier) for this App. '[DEFAULT]' is the default
@@ -133,67 +55,6 @@ export class FirebaseApp {
13355
delete(): Promise<void>;
13456
}
13557

136-
/**
137-
* A {@link @firebase/app#FirebaseServerApp} holds the initialization information
138-
* for a collection of services running in server enviornments.
139-
*
140-
* Do not call this constructor directly. Instead, use
141-
* {@link (initializeServerAppInstance:1) | initializeServerAppInstance()} to create
142-
* an app.
143-
*
144-
* @public
145-
*/
146-
export class FirebaseServerApp extends FirebaseApp {
147-
/**
148-
* Checks to see if the verification of the authIdToken provided to
149-
* @initializeServerApp has completed.
150-
*
151-
* It is recommend that your application awaits this promise if an authIdToken was
152-
* provided during FirebaseServerApp initialization before invoking getAuth(). If an
153-
* instance of Auth is created before the Auth ID Token is validated, then the token
154-
* will not be used by that instance of the Auth SDK.
155-
*
156-
* The returned Promise is completed immediately if the optional authIdToken parameter
157-
* was omitted from FirebaseServerApp initialization.
158-
*/
159-
authIdTokenVerified: () => Promise<void>;
160-
161-
/**
162-
* Checks to see if the verification of the appCheckToken provided to
163-
* @initializeServerApp has completed. If the optional appCheckToken parameter was
164-
* omitted then the returned Promise is completed immediately.
165-
*
166-
* It is recommend that your application awaits this promise before initializing
167-
* any Firebase products that use AppCheck. The Firebase SDKs will not
168-
* use App Check tokens that are determined to be invalid or those that have not yet
169-
* completed validation.
170-
*
171-
* The returned Promise is completed immediately if the optional appCheckToken
172-
* parameter was omitted from FirebaseServerApp initialization.
173-
*/
174-
appCheckTokenVerified: () => Promise<void>;
175-
176-
/**
177-
* Checks to see if the verification of the installationAuthToken provided to
178-
* @initializeServerApp has completed.
179-
*
180-
* It is recommend that your application awaits this promise before initializing
181-
* any Firebase products that use Firebase Installations. The Firebase SDKs will not
182-
* use Installation Auth tokens that are determined to be invalid or those that have
183-
* not yet completed validation.
184-
*
185-
* The returned Promise is completed immediately if the optional appCheckToken
186-
* parameter was omitted from FirebaseServerApp initialization.
187-
*/
188-
installationAuthTokenVerified: () => Promise<void>;
189-
190-
/**
191-
* There is no get for FirebaseServerApp, name is not relevant—however it's always
192-
* a blank string to conform to the FirebaseApp interface
193-
*/
194-
name: '';
195-
}
196-
19758
export interface FirebaseNamespace {
19859
/**
19960
* Create (and initialize) a FirebaseApp.
@@ -205,7 +66,6 @@ export interface FirebaseNamespace {
20566
options: FirebaseOptions,
20667
config?: FirebaseAppConfig
20768
): FirebaseApp;
208-
20969
/**
21070
* Create (and initialize) a FirebaseApp.
21171
*
@@ -215,18 +75,6 @@ export interface FirebaseNamespace {
21575
*/
21676
initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
21777

218-
/**
219-
* Create (and initialize) a FirebaseServerApp.
220-
*
221-
* @param options - Firebase.AppOptions to configure the app's services, or a
222-
* a FirebaseApp instance which contains the AppOptions within.
223-
* @param config The config for your firebase server app.
224-
*/
225-
initializeServerApp(
226-
options: FirebaseOptions | FirebaseApp,
227-
config: FirebaseServerAppConfig
228-
): FirebaseServerApp;
229-
23078
app: {
23179
/**
23280
* Retrieve an instance of a FirebaseApp.
@@ -246,35 +94,11 @@ export interface FirebaseNamespace {
24694
App: typeof FirebaseApp;
24795
};
24896

249-
serverApp: {
250-
/**
251-
* Retrieve an instance of a FirebaseServerApp.
252-
*
253-
* Usage: firebase.serverApp(name)
254-
*
255-
* @param name The optional name of the server app to return ('[DEFAULT]' if omitted)
256-
*/
257-
(name?: string): FirebaseServerApp;
258-
259-
/**
260-
* For testing FirebaseServerApp instances:
261-
* serverApp() instanceof firebase.app.FirebaseServerApp
262-
*
263-
* DO NOT call this constuctor directly (use firebase.initializeServerApp() instead).
264-
*/
265-
serverApp: typeof FirebaseServerApp;
266-
};
267-
26897
/**
26998
* A (read-only) array of all the initialized Apps.
27099
*/
271100
apps: FirebaseApp[];
272101

273-
/**
274-
* A (read-only) array of all the initialized Server Apps.
275-
*/
276-
serverApps: FirebaseServerApp[];
277-
278102
/**
279103
* Registers a library's name and version for platform logging purposes.
280104
* @param library Name of 1p or 3p library (e.g. firestore, angularfire)

0 commit comments

Comments
 (0)