docs-devsite/installations.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
The Firebase Installations Web SDK. This SDK does not work in a Node.js environment.
| Function | Description |
|---|---|
| <b>function(app, ...)</b> | |
| getInstallations(app) | Returns an instance of Installations associated with the given FirebaseApp instance. |
| <b>function(installations, ...)</b> | |
| deleteInstallations(installations) | Deletes the Firebase Installation and all associated data. |
| getId(installations) | Creates a Firebase Installation if there isn't one for the app and returns the Installation ID. |
| getToken(installations, forceRefresh) | Returns a Firebase Installations auth token, identifying the current Firebase Installation. |
| onIdChange(installations, callback) | Sets a new callback that will get called when Installation ID changes. Returns an unsubscribe function that will remove the callback when called. |
| Interface | Description |
|---|---|
| Installations | Public interface of the Firebase Installations SDK. |
| Type Alias | Description |
|---|---|
| IdChangeCallbackFn | An user defined callback function that gets called when Installations ID changes. |
| IdChangeUnsubscribeFn | Unsubscribe a callback function previously added via IdChangeCallbackFn<!-- -->. |
Returns an instance of Installations associated with the given FirebaseApp instance.
<b>Signature:</b>
export declare function getInstallations(app?: FirebaseApp): Installations;
| Parameter | Type | Description |
|---|---|---|
| app | FirebaseApp | The FirebaseApp instance. |
<b>Returns:</b>
Deletes the Firebase Installation and all associated data.
<b>Signature:</b>
export declare function deleteInstallations(installations: Installations): Promise<void>;
| Parameter | Type | Description |
|---|---|---|
| installations | Installations | The <code>Installations</code> instance. |
<b>Returns:</b>
Promise<void>
Creates a Firebase Installation if there isn't one for the app and returns the Installation ID.
<b>Signature:</b>
export declare function getId(installations: Installations): Promise<string>;
| Parameter | Type | Description |
|---|---|---|
| installations | Installations | The <code>Installations</code> instance. |
<b>Returns:</b>
Promise<string>
Returns a Firebase Installations auth token, identifying the current Firebase Installation.
<b>Signature:</b>
export declare function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>;
| Parameter | Type | Description |
|---|---|---|
| installations | Installations | The <code>Installations</code> instance. |
| forceRefresh | boolean | Force refresh regardless of token expiration. |
<b>Returns:</b>
Promise<string>
Sets a new callback that will get called when Installation ID changes. Returns an unsubscribe function that will remove the callback when called.
<b>Signature:</b>
export declare function onIdChange(installations: Installations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn;
| Parameter | Type | Description |
|---|---|---|
| installations | Installations | The <code>Installations</code> instance. |
| callback | IdChangeCallbackFn | The callback function that is invoked when FID changes. |
<b>Returns:</b>
A function that can be called to unsubscribe.
An user defined callback function that gets called when Installations ID changes.
<b>Signature:</b>
export type IdChangeCallbackFn = (installationId: string) => void;
Unsubscribe a callback function previously added via IdChangeCallbackFn<!-- -->.
<b>Signature:</b>
export type IdChangeUnsubscribeFn = () => void;