firebase_admin module
Stay organized with collections
Save and categorize content based on your preferences.
Firebase Admin SDK for Python.
Classes
Appclass firebase_admin.App(name, credential, options) |
---|
Bases: object
The entry point for Firebase Python SDK.
Represents a Firebase app, while holding the configuration and state
common to all Firebase APIs.
|
Functions
delete_appfirebase_admin.delete_app(app) |
---|
Gracefully deletes an App instance.
- Parameters:
app – The app instance to be deleted.
- Raises:
ValueError – If the app is not initialized.
|
get_appfirebase_admin.get_app(name='[DEFAULT]') |
---|
Retrieves an App instance by name.
- Parameters:
name – Name of the App instance to retrieve (optional).
- Returns:
An App instance with the given name.
- Return type:
App
- Raises:
ValueError – If the specified name is not a string, or if the specified
app does not exist.
|
initialize_appfirebase_admin.initialize_app(credential=None, options=None, name='[DEFAULT]') |
---|
Initializes and returns a new App instance.
Creates a new App instance using the specified options
and the app name. If an instance already exists by the same
app name a ValueError is raised.
If options are not provided an attempt is made to load the options from the environment.
This is done by looking up the FIREBASE_CONFIG environment variable. If the value of
the variable starts with "{" , it is parsed as a JSON object. Otherwise it is treated
as a file name and the JSON content is read from the corresponding file.
Use this function whenever a new App instance is required. Do not directly invoke the
App constructor.
- Parameters:
credential – A credential object used to initialize the SDK (optional). If none is provided,
Google Application Default Credentials are used.
options – A dictionary of configuration options (optional). Supported options include
databaseURL , storageBucket , projectId , databaseAuthVariableOverride ,
serviceAccountId and httpTimeout . If httpTimeout is not set, the SDK uses
a default timeout of 120 seconds.
name – Name of the app (optional).
- Returns:
A newly initialized instance of App.
- Return type:
App
- Raises:
ValueError – If the app name is already in use, or any of the
provided arguments are invalid.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-12 UTC.
[null,null,["Last updated 2025-03-12 UTC."],[],[],null,["# firebase_admin module\n\nFirebase Admin SDK for Python.\n\nClasses\n-------\n\n| ### App *class* firebase_admin.App(*name* , *credential* , *options* ) |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Bases: object The entry point for Firebase Python SDK. Represents a Firebase app, while holding the configuration and state common to all Firebase APIs. | *property* credential | |-----------------------| | | | *property* name | |-----------------| | | | *property* options | |--------------------| | | | *property* project_id | |-----------------------| | | |\n\nFunctions\n---------\n\n| ### delete_app firebase_admin.delete_app(*app* ) |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Gracefully deletes an App instance. Parameters: : **app** -- The app instance to be deleted. Raises: : **ValueError** -- If the app is not initialized. |\n\n| ### get_app firebase_admin.get_app(*name='\\[DEFAULT\\]'* ) |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Retrieves an App instance by name. Parameters: : **name** -- Name of the App instance to retrieve (optional). Returns: : An App instance with the given name. Return type: : [App](#firebase_admin.App \"firebase_admin.App\") Raises: : **ValueError** -- If the specified name is not a string, or if the specified app does not exist. |\n\n| ### initialize_app firebase_admin.initialize_app(*credential=None* , *options=None* , *name='\\[DEFAULT\\]'* ) |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Initializes and returns a new App instance. Creates a new App instance using the specified options and the app name. If an instance already exists by the same app name a ValueError is raised. If options are not provided an attempt is made to load the options from the environment. This is done by looking up the FIREBASE_CONFIG environment variable. If the value of the variable starts with \"{\", it is parsed as a JSON object. Otherwise it is treated as a file name and the JSON content is read from the corresponding file. Use this function whenever a new App instance is required. Do not directly invoke the App constructor. Parameters: : - **credential** -- A credential object used to initialize the SDK (optional). If none is provided, Google Application Default Credentials are used. - **options** -- A dictionary of configuration options (optional). Supported options include databaseURL, storageBucket, projectId, databaseAuthVariableOverride, serviceAccountId and httpTimeout. If httpTimeout is not set, the SDK uses a default timeout of 120 seconds. - **name** -- Name of the app (optional). Returns: : A newly initialized instance of App. Return type: : [App](#firebase_admin.App \"firebase_admin.App\") Raises: : **ValueError** -- If the app name is already in use, or any of the provided arguments are invalid. |"]]