diff --git a/common/api-review/app.api.md b/common/api-review/app.api.md index 087318ae27f..f05a07c5499 100644 --- a/common/api-review/app.api.md +++ b/common/api-review/app.api.md @@ -73,18 +73,14 @@ export interface FirebaseOptions { // @public export interface FirebaseServerApp extends FirebaseApp { - appCheckTokenVerified: () => Promise; authIdTokenVerified: () => Promise; - installationTokenVerified: () => Promise; name: string; readonly settings: FirebaseServerAppSettings; } // @public export interface FirebaseServerAppSettings extends FirebaseAppSettings { - appCheckToken?: string; authIdToken?: string; - installationsAuthToken?: string; name?: undefined; releaseOnDeref?: object; } diff --git a/docs-devsite/app.firebaseserverapp.md b/docs-devsite/app.firebaseserverapp.md index 387e27a9822..b0198ce4951 100644 --- a/docs-devsite/app.firebaseserverapp.md +++ b/docs-devsite/app.firebaseserverapp.md @@ -12,7 +12,7 @@ https://github.com/firebase/firebase-js-sdk # 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. +Do not call this constructor directly. Instead, use [initializeServerApp()](./app.md#initializeserverapp_30ab697) to create an app. Signature: @@ -25,31 +25,15 @@ export interface FirebaseServerApp extends FirebaseApp | Property | Type | Description | | --- | --- | --- | -| [appCheckTokenVerified](./app.firebaseserverapp.md#firebaseserverappappchecktokenverified) | () => Promise<void> | Checks to see if the verification of the appCheckToken provided to has completed. If the optional appCheckToken parameter was omitted then the returned Promise is completed immediately.It is recommend that your application awaits this promise before initializing any Firebase products that use AppCheck. The Firebase SDKs will not use App Check tokens that are determined to be invalid or those that have not yet completed validation.The returned Promise is completed immediately if the optional appCheckToken parameter was omitted from FirebaseServerApp initialization. | -| [authIdTokenVerified](./app.firebaseserverapp.md#firebaseserverappauthidtokenverified) | () => Promise<void> | Checks to see if the verification of the authIdToken provided to has completed.It is recommend that your application awaits this promise if an authIdToken was provided during FirebaseServerApp initialization before invoking getAuth(). If an instance of Auth is created before the Auth ID Token is validated, then the token will not be used by that instance of the Auth SDK.The returned Promise is completed immediately if the optional authIdToken parameter was omitted from FirebaseServerApp initialization. | -| [installationTokenVerified](./app.firebaseserverapp.md#firebaseserverappinstallationtokenverified) | () => Promise<void> | Checks to see if the verification of the installationToken provided to has completed.It is recommend that your application awaits this promise before initializing any Firebase products that use Firebase Installations. The Firebase SDKs will not use Installation Auth tokens that are determined to be invalid or those that have not yet completed validation.The returned Promise is completed immediately if the optional appCheckToken parameter was omitted from FirebaseServerApp initialization. | -| [name](./app.firebaseserverapp.md#firebaseserverappname) | string | There is no get for FirebaseServerApp, so the name is not relevant. However, it's declared here so that FirebaseServerApp conforms to the FirebaseApp interface declaration. Internally this string will always be empty for FirebaseServerApp instances. | +| [authIdTokenVerified](./app.firebaseserverapp.md#firebaseserverappauthidtokenverified) | () => Promise<void> | Checks to see if the local verification of the authIdToken provided to [initializeServerApp()](./app.md#initializeserverapp_30ab697) has completed.It is recommend that your application awaits this promise before invoking getAuth() if an authIdToken was provided in the FirebaseServerAppSettings.The returned Promise is completed immediately if the optional authIdToken parameter was omitted from FirebaseServerApp initialization. | +| [name](./app.firebaseserverapp.md#firebaseserverappname) | string | There is no getApp operation for FirebaseServerApps, so the name is not relevant for applications. However, it may be used internally, and is declared here so that FirebaseServerApp conforms to the FirebaseApp interface declaration. | | [settings](./app.firebaseserverapp.md#firebaseserverappsettings) | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | The (read-only) configuration settings for this server app. These are the original parameters given in [initializeServerApp()](./app.md#initializeserverapp_30ab697). | -## FirebaseServerApp.appCheckTokenVerified - -Checks to see if the verification of the appCheckToken provided to has completed. If the optional appCheckToken parameter was omitted then the returned Promise is completed immediately. - -It is recommend that your application awaits this promise before initializing any Firebase products that use AppCheck. The Firebase SDKs will not use App Check tokens that are determined to be invalid or those that have not yet completed validation. - -The returned Promise is completed immediately if the optional appCheckToken parameter was omitted from FirebaseServerApp initialization. - -Signature: - -```typescript -appCheckTokenVerified: () => Promise; -``` - ## FirebaseServerApp.authIdTokenVerified -Checks to see if the verification of the authIdToken provided to has completed. +Checks to see if the local verification of the authIdToken provided to [initializeServerApp()](./app.md#initializeserverapp_30ab697) has completed. -It is recommend that your application awaits this promise if an authIdToken was provided during FirebaseServerApp initialization before invoking getAuth(). If an instance of Auth is created before the Auth ID Token is validated, then the token will not be used by that instance of the Auth SDK. +It is recommend that your application awaits this promise before invoking getAuth() if an authIdToken was provided in the FirebaseServerAppSettings. The returned Promise is completed immediately if the optional authIdToken parameter was omitted from FirebaseServerApp initialization. @@ -59,23 +43,9 @@ The returned Promise is completed immediately if the optional authIdToken parame authIdTokenVerified: () => Promise; ``` -## FirebaseServerApp.installationTokenVerified - -Checks to see if the verification of the installationToken provided to has completed. - -It is recommend that your application awaits this promise before initializing any Firebase products that use Firebase Installations. The Firebase SDKs will not use Installation Auth tokens that are determined to be invalid or those that have not yet completed validation. - -The returned Promise is completed immediately if the optional appCheckToken parameter was omitted from FirebaseServerApp initialization. - -Signature: - -```typescript -installationTokenVerified: () => Promise; -``` - ## FirebaseServerApp.name -There is no get for FirebaseServerApp, so the name is not relevant. However, it's declared here so that FirebaseServerApp conforms to the FirebaseApp interface declaration. Internally this string will always be empty for FirebaseServerApp instances. +There is no getApp operation for FirebaseServerApps, so the name is not relevant for applications. However, it may be used internally, and is declared here so that FirebaseServerApp conforms to the FirebaseApp interface declaration. Signature: diff --git a/docs-devsite/app.firebaseserverappsettings.md b/docs-devsite/app.firebaseserverappsettings.md index 54ba13baa11..4edf299fe8e 100644 --- a/docs-devsite/app.firebaseserverappsettings.md +++ b/docs-devsite/app.firebaseserverappsettings.md @@ -23,58 +23,26 @@ export interface FirebaseServerAppSettings extends FirebaseAppSettings | Property | Type | Description | | --- | --- | --- | -| [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. | -| [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. | -| [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. | +| [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 even before Auth is initialized. The result of the validation can be queried via by the application by invoking . Awaiting the Promise returned by is highly recommended if an authIdToken token is provided.Invoking getAuth() with a FirebaseServerApp configured with a validated authIdToken will cause an automatic attempt to sign in the user that the authIdToken represents. The token needs to have been recently minted for this operation to succeed, otherwise it will fail validation.If the token fails local verification, or if the Auth service has deemed it invalid when the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not sign in a user upon initalization.If a user is successfully signed-in, then the Auth instance's onAuthStateChanged callback will be invoked with the User as per standard Auth flows. However, users created via authIdTokens do not have a refresh token and any attempted refresh operation will fail. | | [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. | -| [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. | - -## FirebaseServerAppSettings.appCheckToken - -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. - -Signature: - -```typescript -appCheckToken?: string; -``` +| [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 garbage collected.The intent of this field is to help reduce memory overhead for long-running cloud functions. If provided, the customer's app running in a SSR pass need not worry about FirebaseServerApp cleanup, so long as the reference object is deleted (by falling out of SSR scope, for instance.)If an object is not provided then the application must clean up the FirebaseServerApp instance by invoking deleteApp.If the application 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. | ## FirebaseServerAppSettings.authIdToken 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. +If provided, the FirebaseServerApp instance will work to validate the token even before Auth is initialized. The result of the validation can be queried via by the application by invoking . Awaiting the Promise returned by is highly recommended if an authIdToken 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. +Invoking getAuth() with a FirebaseServerApp configured with a validated authIdToken will cause an automatic attempt to sign in the user that the authIdToken represents. The token needs to have been recently minted for this operation to succeed, otherwise it will fail validation. -If the token fails verification then a warning is logged and Auth SDK will not attempt to sign in a user upon its initalization. +If the token fails local verification, or if the Auth service has deemed it invalid when the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not sign in a user upon initalization. -Signature: - -```typescript -authIdToken?: string; -``` - -## FirebaseServerAppSettings.installationsAuthToken - -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. +If a user is successfully signed-in, then the Auth instance's onAuthStateChanged callback will be invoked with the User as per standard Auth flows. However, users created via authIdTokens do not have a refresh token and any attempted refresh operation will fail. Signature: ```typescript -installationsAuthToken?: string; +authIdToken?: string; ``` ## FirebaseServerAppSettings.name @@ -89,13 +57,13 @@ name?: undefined; ## FirebaseServerAppSettings.releaseOnDeref -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. +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 garbage collected. -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. +The intent of this field is to help reduce memory overhead for long-running cloud functions. If provided, the customer's app running in a SSR pass need not worry about FirebaseServerApp cleanup, so long as the reference object is deleted (by falling out of SSR scope, for instance.) -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 an object is not provided then the application must clean up the FirebaseServerApp instance 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. +If the application 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. Signature: diff --git a/docs-devsite/app.md b/docs-devsite/app.md index b12c29819c9..a36bdc065f7 100644 --- a/docs-devsite/app.md +++ b/docs-devsite/app.md @@ -34,7 +34,7 @@ This package coordinates the communication between the different Firebase compon | function(options, ...) | | [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. | | [initializeApp(options, config)](./app.md#initializeapp_079e917) | Creates and initializes a FirebaseApp instance. | -| [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. | +| [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. Initialization will fail if invoked from a browser environment.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. | ## Interfaces @@ -43,7 +43,7 @@ This package coordinates the communication between the different Firebase compon | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | A [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) holds the initialization information for a collection of services.Do not call this constructor directly. Instead, use [initializeApp()](./app.md#initializeapp_cb2f5e1) to create an app. | | [FirebaseAppSettings](./app.firebaseappsettings.md#firebaseappsettings_interface) | Configuration options given to [initializeApp()](./app.md#initializeapp_cb2f5e1) | | [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). | -| [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. | +| [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 [initializeServerApp()](./app.md#initializeserverapp_30ab697) to create an app. | | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | Configuration options given to [initializeServerApp()](./app.md#initializeserverapp_30ab697) | ## Variables @@ -317,7 +317,7 @@ export declare function initializeApp(options: FirebaseOptions, config?: Firebas 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. +The FirebaseServerApp is similar to FirebaseApp, but is intended for execution in server side rendering environments only. Initialization will fail if invoked from a browser environment. 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. diff --git a/packages/app/src/api.ts b/packages/app/src/api.ts index e3812fd7538..c8383d06fd9 100644 --- a/packages/app/src/api.ts +++ b/packages/app/src/api.ts @@ -184,7 +184,8 @@ export function initializeApp( * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance. * * The FirebaseServerApp is similar to FirebaseApp, but is intended for execution in - * server side rendering environments only. + * server side rendering environments only. Initialization will fail if invoked from a + * browser environment. * * See * {@link @@ -248,8 +249,6 @@ export function initializeServerApp( const nameObj = { authIdToken: _serverAppConfig?.authIdToken, - appCheckToken: _serverAppConfig?.appCheckToken, - installationsAuthToken: _serverAppConfig?.installationsAuthToken, ...appOptions }; @@ -271,7 +270,7 @@ export function initializeServerApp( }; const nameString = '' + hashCode(JSON.stringify(nameObj)); - const existingApp = _serverApps.get(nameString) as FirebaseServerAppImpl; + const existingApp = _serverApps.get(nameString) as FirebaseServerApp; if (existingApp) { // TODO: // 1: Register a new reference to finalization registry. diff --git a/packages/app/src/public-types.ts b/packages/app/src/public-types.ts index 04ba4f0b24c..463bd694a05 100644 --- a/packages/app/src/public-types.ts +++ b/packages/app/src/public-types.ts @@ -76,20 +76,18 @@ export interface FirebaseApp { * for a collection of services running in server enviornments. * * Do not call this constructor directly. Instead, use - * {@link (initializeServerAppInstance:1) | initializeServerAppInstance()} to create + * {@link (initializeServerApp:1) | initializeServerApp()} to create * an app. * * @public */ export interface FirebaseServerApp extends FirebaseApp { /** - * Checks to see if the verification of the authIdToken provided to - * @initializeServerApp has completed. + * Checks to see if the local verification of the authIdToken provided to + * {@link (initializeServerApp:1) | initializeServerApp()} has completed. * - * It is recommend that your application awaits this promise if an authIdToken was - * provided during FirebaseServerApp initialization before invoking getAuth(). If an - * instance of Auth is created before the Auth ID Token is validated, then the token - * will not be used by that instance of the Auth SDK. + * It is recommend that your application awaits this promise before invoking getAuth() if an + * authIdToken was provided in the FirebaseServerAppSettings. * * The returned Promise is completed immediately if the optional authIdToken parameter * was omitted from FirebaseServerApp initialization. @@ -97,39 +95,9 @@ export interface FirebaseServerApp extends FirebaseApp { authIdTokenVerified: () => Promise; /** - * Checks to see if the verification of the appCheckToken provided to - * @initializeServerApp has completed. If the optional appCheckToken parameter was - * omitted then the returned Promise is completed immediately. - * - * It is recommend that your application awaits this promise before initializing - * any Firebase products that use AppCheck. The Firebase SDKs will not - * use App Check tokens that are determined to be invalid or those that have not yet - * completed validation. - * - * The returned Promise is completed immediately if the optional appCheckToken - * parameter was omitted from FirebaseServerApp initialization. - */ - appCheckTokenVerified: () => Promise; - - /** - * Checks to see if the verification of the installationToken provided to - * @initializeServerApp has completed. - * - * It is recommend that your application awaits this promise before initializing - * any Firebase products that use Firebase Installations. The Firebase SDKs will not - * use Installation Auth tokens that are determined to be invalid or those that have - * not yet completed validation. - * - * The returned Promise is completed immediately if the optional appCheckToken - * parameter was omitted from FirebaseServerApp initialization. - */ - - installationTokenVerified: () => Promise; - - /** - * There is no get for FirebaseServerApp, so the name is not relevant. However, it's declared here - * so that FirebaseServerApp conforms to the FirebaseApp interface declaration. Internally this - * string will always be empty for FirebaseServerApp instances. + * There is no getApp operation for FirebaseServerApps, so the name is not relevant for + * applications. However, it may be used internally, and is declared here so that + * FirebaseServerApp conforms to the FirebaseApp interface declaration. */ name: string; @@ -224,69 +192,42 @@ export interface FirebaseServerAppSettings extends FirebaseAppSettings { * 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 provided, the FirebaseServerApp instance will work to validate the token even before Auth + * is initialized. The result of the validation can be queried via by the application by invoking + * {@link (FirebaseServerApp.authIdTokenVerified()}. Awaiting the Promise returned by + * {@link (FirebaseServerApp.authIdTokenVerified()} is highly recommended if an authIdToken token + * is provided. * - * If the token fails verification then a warning is logged and Auth SDK will not - * attempt to sign in a user upon its initalization. - */ - authIdToken?: 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. + * Invoking getAuth() with a FirebaseServerApp configured with a validated authIdToken will cause + * an automatic attempt to sign in the user that the authIdToken represents. The token + * needs to have been recently minted for this operation to succeed, otherwise it will fail + * validation. * - * If the token fails verification then a warning is logged and the token will not - * be used. - */ - appCheckToken?: string; - - /** - * An optional Installation Auth token. + * If the token fails local verification, or if the Auth service has deemed it invalid when + * the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not + * sign in a user upon initalization. * - * 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. + * If a user is successfully signed-in, then the Auth instance's onAuthStateChanged callback + * will be invoked with the User as per standard Auth flows. However, users created via + * authIdTokens do not have a refresh token and any attempted refresh operation will fail. */ - installationsAuthToken?: string; + authIdToken?: string; /** * 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. + * provided object is garbage collected. * * 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. + * functions. If provided, the customer's app running in a SSR pass need not worry about + * FirebaseServerApp cleanup, so long as the reference object is deleted (by falling out of + * SSR scope, for instance.) * - * 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 an object is not provided then the application must clean up the FirebaseServerApp instance + * by invoking deleteApp. * - * If the app provides an object in this parameter, but the application is + * If the application 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