Firebase
import { Firebase } from "https://googleapis.deno.dev/v1/firebase:v1beta1.ts";
The Firebase Management API enables programmatic setup and management of Firebase projects, including a project's Firebase resources and Firebase apps.
§Methods
Lists each [Google Cloud Platform (GCP) Project
]
(https://cloud.google.com/resource-manager/reference/rest/v1/projects) that
can have Firebase resources added to it. A Project will only be listed if:
- The caller has sufficient Google IAM permissions to call AddFirebase. - The Project is not already a FirebaseProject. - The Project is not in an Organization which has policies that prevent Firebase resources from being added.
Adds Firebase resources to the specified existing [Google Cloud Platform
(GCP) Project
]
(https://cloud.google.com/resource-manager/reference/rest/v1/projects).
Since a FirebaseProject is actually also a GCP Project
, a
FirebaseProject
has the same underlying GCP identifiers (projectNumber
and projectId
). This allows for easy interop with Google APIs. The result
of this call is an Operation
. Poll the
Operation
to track the provisioning process by calling GetOperation until
done
is true
. When
done
is true
, the Operation
has either succeeded or failed. If the
Operation
succeeded, its
response
is set to
a FirebaseProject; if the Operation
failed, its
error
is set to a
google.rpc.Status. The Operation
is automatically deleted after
completion, so there is no need to call DeleteOperation. This method does
not modify any billing account information on the underlying GCP Project
.
To call AddFirebase
, a project member or service account must have the
following permissions (the IAM roles of Editor and Owner contain these
permissions): firebase.projects.update
, resourcemanager.projects.get
,
serviceusage.services.enable
, and serviceusage.services.get
.
The resource name of the GCP Project
to which Firebase resources will be added, in the format: projects/PROJECT_IDENTIFIER Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values. After calling AddFirebase
, the unique Project identifiers ( projectNumber
and projectId
) of the underlying GCP Project
are also the identifiers of the FirebaseProject.
Links the specified FirebaseProject with an existing Google Analytics
account. Using this call, you can
either: - Specify an analyticsAccountId
to provision a new Google
Analytics property within the specified account and associate the new
property with the FirebaseProject
. - Specify an existing
analyticsPropertyId
to associate the property with the FirebaseProject
.
Note that when you call AddGoogleAnalytics
: 1. The first check determines
if any existing data streams in the Google Analytics property correspond to
any existing Firebase Apps in the FirebaseProject
(based on the
packageName
or bundleId
associated with the data stream). Then, as
applicable, the data streams and apps are linked. Note that this
auto-linking only applies to AndroidApps
and IosApps
. 2. If no
corresponding data streams are found for the Firebase Apps, new data
streams are provisioned in the Google Analytics property for each of the
Firebase Apps. Note that a new data stream is always provisioned for a Web
App even if it was previously associated with a data stream in the
Analytics property. Learn more about the hierarchy and structure of Google
Analytics accounts in the Analytics
documentation. The
result of this call is an Operation
. Poll the
Operation
to track the provisioning process by calling GetOperation until
done
is true
. When
done
is true
, the Operation
has either succeeded or failed. If the
Operation
succeeded, its
response
is set to
an AnalyticsDetails; if the Operation
failed, its
error
is set to a
google.rpc.Status. To call AddGoogleAnalytics
, a project member must be
an Owner for the existing FirebaseProject
and have the Edit
permission for the
Google Analytics account. If the FirebaseProject
already has Google
Analytics enabled, and you call AddGoogleAnalytics
using an
analyticsPropertyId
that's different from the currently associated
property, then the call will fail. Analytics may have already been enabled
in the Firebase console or by specifying timeZone
and regionCode
in the
call to AddFirebase
.
The resource name of the FirebaseProject to link to an existing Google Analytics account, in the format: projects/PROJECT_IDENTIFIER Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Requests the creation of a new AndroidApp in the specified
FirebaseProject. The result of this call is an Operation
which can be
used to track the provisioning process. The Operation
is automatically
deleted after completion, so there is no need to call DeleteOperation
.
The resource name of the parent FirebaseProject in which to create an AndroidApp, in the format: projects/PROJECT_IDENTIFIER/androidApps Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Gets the specified AndroidApp.
The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp
name
field for details about PROJECT_IDENTIFIER and APP_ID values.
Gets the configuration artifact associated with the specified AndroidApp.
The resource name of the AndroidApp configuration to download, in the format: projects/PROJECT_IDENTIFIER/androidApps/APP_ID/config Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp
name
field for details about PROJECT_IDENTIFIER and APP_ID values.
Lists each AndroidApp associated with the specified FirebaseProject. The
elements are returned in no particular order, but will be a consistent view
of the Apps when additional requests are made with a pageToken
.
The resource name of the parent FirebaseProject for which to list each associated AndroidApp, in the format: projects/PROJECT_IDENTIFIER /androidApps Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Updates the attributes of the specified AndroidApp.
The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID * PROJECT_IDENTIFIER: the parent Project's ProjectNumber
(recommended) or its ProjectId
. Learn more about using project identifiers in Google's AIP 2510 standard. Note that the value for PROJECT_IDENTIFIER in any response body will be the ProjectId
. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see appId
).
Removes the specified AndroidApp from the FirebaseProject.
Required. The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp name field for details about PROJECT_IDENTIFIER and APP_ID values.
Adds a ShaCertificate to the specified AndroidApp.
The resource name of the parent AndroidApp to which to add a ShaCertificate, in the format: projects/PROJECT_IDENTIFIER/androidApps/ APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp
name
field for details about PROJECT_IDENTIFIER and APP_ID values.
Removes a ShaCertificate from the specified AndroidApp.
The resource name of the ShaCertificate to remove from the parent AndroidApp, in the format: projects/PROJECT_IDENTIFIER/androidApps/APP_ID /sha/SHA_HASH Refer to the ShaCertificate
name
field for details about PROJECT_IDENTIFIER, APP_ID, and SHA_HASH values. You can obtain the full resource name of the ShaCertificate
from the response of ListShaCertificates
or the original CreateShaCertificate
.
Lists the SHA-1 and SHA-256 certificates for the specified AndroidApp.
The resource name of the parent AndroidApp for which to list each associated ShaCertificate, in the format: projects/PROJECT_IDENTIFIER /androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp
name
field for details about PROJECT_IDENTIFIER and APP_ID values.
Restores the specified AndroidApp to the FirebaseProject.
Required. The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp name field for details about PROJECT_IDENTIFIER and APP_ID values.
DEPRECATED. Instead, use the applicable resource-specific REST API
(or associated documentation, as needed) to determine valid locations for
each resource used in your Project. Lists the valid Google Cloud Platform
(GCP) resource locations for the specified Project (including a
FirebaseProject). One of these locations can be selected as the Project's
default GCP resource
location, which is
the geographical location where the Project's resources, such as Cloud
Firestore, will be provisioned by default. However, if the default GCP
resource location has already been set for the Project, then this setting
cannot be changed. This call checks for any possible location
restrictions
for the specified Project and, thus, might return a subset of all possible
GCP resource locations. To list all GCP resource locations (regardless of
any restrictions), call the endpoint without specifying a unique project
identifier (that is,
/v1beta1/{parent=projects/-}/listAvailableLocations
). To call
ListAvailableLocations
with a specified project, a member must be at
minimum a Viewer of the Project. Calls without a specified project do not
require any specific project permissions.
The FirebaseProject for which to list GCP resource locations, in the format: projects/PROJECT_IDENTIFIER Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values. If no unique project identifier is specified (that is, projects/-
), the returned list does not take into account org-specific or project-specific location restrictions.
DEPRECATED. Instead, use the applicable resource-specific REST API to
set the location for each resource used in your Project. Sets the default
Google Cloud Platform (GCP) resource location for the specified
FirebaseProject. This method creates an App Engine application with a
default Cloud Storage
bucket,
located in the specified
locationId
. This location must
be one of the available GCP resource
locations. After the
default GCP resource location is finalized, or if it was already set, it
cannot be changed. The default GCP resource location for the specified
FirebaseProject
might already be set because either the underlying GCP
Project
already has an App Engine application or
FinalizeDefaultLocation
was previously called with a specified
locationId
. Any new calls to FinalizeDefaultLocation
with a different
specified locationId
will return a 409 error. The result of this call is
an Operation
, which can be used to track the
provisioning process. The
response
type of
the Operation
is google.protobuf.Empty. The Operation
can be polled by
its name
using GetOperation until done
is true. When done
is true,
the Operation
has either succeeded or failed. If the Operation
has
succeeded, its
response
will be
set to a google.protobuf.Empty; if the Operation
has failed, its error
will be set to a google.rpc.Status. The Operation
is automatically
deleted after completion, so there is no need to call DeleteOperation. All
fields listed in the request body are required. To call
FinalizeDefaultLocation
, a member must be an Owner of the Project.
The resource name of the FirebaseProject for which the default GCP resource location will be set, in the format: projects/PROJECT_IDENTIFIER Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Gets the specified FirebaseProject.
The resource name of the FirebaseProject, in the format: projects/ PROJECT_IDENTIFIER Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Gets the configuration artifact associated with the specified FirebaseProject, which can be used by servers to simplify initialization. Typically, this configuration is used with the Firebase Admin SDK initializeApp command.
The resource name of the FirebaseProject, in the format: projects/ PROJECT_IDENTIFIER/adminSdkConfig Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Gets the Google Analytics details currently associated with the specified
FirebaseProject. If the FirebaseProject
is not yet linked to Google
Analytics, then the response to GetAnalyticsDetails
is NOT_FOUND
.
The resource name of the FirebaseProject, in the format: projects/ PROJECT_IDENTIFIER/analyticsDetails Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Requests the creation of a new IosApp in the specified FirebaseProject.
The result of this call is an Operation
which can be used to track the
provisioning process. The Operation
is automatically deleted after
completion, so there is no need to call DeleteOperation
.
The resource name of the parent FirebaseProject in which to create an IosApp, in the format: projects/PROJECT_IDENTIFIER/iosApps Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Gets the specified IosApp.
The resource name of the IosApp, in the format: projects/PROJECT_IDENTIFIER /iosApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the IosApp
name
field for details about PROJECT_IDENTIFIER and APP_ID values.
Gets the configuration artifact associated with the specified IosApp.
The resource name of the App configuration to download, in the format: projects/PROJECT_IDENTIFIER/iosApps/APP_ID/config Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the IosApp
name
field for details about PROJECT_IDENTIFIER and APP_ID values.
Lists each IosApp associated with the specified FirebaseProject. The
elements are returned in no particular order, but will be a consistent view
of the Apps when additional requests are made with a pageToken
.
The resource name of the parent FirebaseProject for which to list each associated IosApp, in the format: projects/PROJECT_IDENTIFIER/iosApps Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Updates the attributes of the specified IosApp.
The resource name of the IosApp, in the format: projects/PROJECT_IDENTIFIER /iosApps/APP_ID * PROJECT_IDENTIFIER: the parent Project's ProjectNumber
(recommended) or its ProjectId
. Learn more about using project identifiers in Google's AIP 2510 standard. Note that the value for PROJECT_IDENTIFIER in any response body will be the ProjectId
. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see appId
).
Removes the specified IosApp from the FirebaseProject.
Required. The resource name of the IosApp, in the format: projects/ PROJECT_IDENTIFIER/iosApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the IosApp name field for details about PROJECT_IDENTIFIER and APP_ID values.
Restores the specified IosApp to the FirebaseProject.
Required. The resource name of the IosApp, in the format: projects/ PROJECT_IDENTIFIER/iosApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the IosApp name field for details about PROJECT_IDENTIFIER and APP_ID values.
Lists each FirebaseProject accessible to the caller. The elements are
returned in no particular order, but they will be a consistent view of the
Projects when additional requests are made with a pageToken
. This method
is eventually consistent with Project mutations, which means newly
provisioned Projects and recent modifications to existing Projects might
not be reflected in the set of Projects. The list will include only ACTIVE
Projects. Use GetFirebaseProject for consistent reads as well as for
additional Project details.
Updates the attributes of the specified FirebaseProject. All query parameters are required.
The resource name of the Project, in the format: projects/PROJECT_IDENTIFIER PROJECT_IDENTIFIER: the Project's ProjectNumber
(recommended) or its ProjectId
. Learn more about using project identifiers in Google's AIP 2510 standard. Note that the value for PROJECT_IDENTIFIER in any response body will be the ProjectId
.
Unlinks the specified FirebaseProject from its Google Analytics account.
This call removes the association of the specified FirebaseProject
with
its current Google Analytics property. However, this call does not delete
the Google Analytics resources, such as the Google Analytics property or
any data streams. These resources may be re-associated later to the
FirebaseProject
by calling
AddGoogleAnalytics
and
specifying the same analyticsPropertyId
. For Android Apps and iOS Apps,
this call re-links data streams with their corresponding apps. However, for
Web Apps, this call provisions a new data stream for each Web App. To
call RemoveAnalytics
, a project member must be an Owner for the
FirebaseProject
.
The resource name of the FirebaseProject to unlink from its Google Analytics account, in the format: projects/PROJECT_IDENTIFIER Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Lists all available Apps for the specified FirebaseProject. This is a convenience method. Typically, interaction with an App should be done using the platform-specific service, but some tool use-cases require a summary of all known Apps (such as for App selector interfaces).
The parent FirebaseProject for which to list Apps, in the format: projects/ PROJECT_IDENTIFIER Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Requests the creation of a new WebApp in the specified FirebaseProject.
The result of this call is an Operation
which can be used to track the
provisioning process. The Operation
is automatically deleted after
completion, so there is no need to call DeleteOperation
.
The resource name of the parent FirebaseProject in which to create a WebApp, in the format: projects/PROJECT_IDENTIFIER/webApps Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Gets the specified WebApp.
The resource name of the WebApp, in the format: projects/PROJECT_IDENTIFIER /webApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the WebApp
name
field for details about PROJECT_IDENTIFIER and APP_ID values.
Gets the configuration artifact associated with the specified WebApp.
The resource name of the WebApp configuration to download, in the format: projects/PROJECT_IDENTIFIER/webApps/APP_ID/config Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the WebApp
name
field for details about PROJECT_IDENTIFIER and APP_ID values.
Lists each WebApp associated with the specified FirebaseProject. The
elements are returned in no particular order, but will be a consistent view
of the Apps when additional requests are made with a pageToken
.
The resource name of the parent FirebaseProject for which to list each associated WebApp, in the format: projects/PROJECT_IDENTIFIER/webApps Refer to the FirebaseProject
name
field for details about PROJECT_IDENTIFIER values.
Updates the attributes of the specified WebApp.
The resource name of the WebApp, in the format: projects/PROJECT_IDENTIFIER /webApps/APP_ID * PROJECT_IDENTIFIER: the parent Project's ProjectNumber
(recommended) or its ProjectId
. Learn more about using project identifiers in Google's AIP 2510 standard. Note that the value for PROJECT_IDENTIFIER in any response body will be the ProjectId
. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see appId
).
Removes the specified WebApp from the FirebaseProject.
Required. The resource name of the WebApp, in the format: projects/ PROJECT_IDENTIFIER/webApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the WebApp name field for details about PROJECT_IDENTIFIER and APP_ID values.
Restores the specified WebApp to the FirebaseProject.
Required. The resource name of the WebApp, in the format: projects/ PROJECT_IDENTIFIER/webApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the WebApp name field for details about PROJECT_IDENTIFIER and APP_ID values.