Go to console

Firebase Admin Python SDK Release Notes

To review release notes for the Firebase console and for other Firebase platforms and related SDKs, refer to the Firebase Release Notes.

Version 3.2.1 - 11 December, 2019

Cloud Messaging

  • Boolean parameters in AndroidNotification are now correctly encoded.

Version 3.2.0 - 13 November, 2019

Cloud Messaging

  • Added a series of new parameters to the AndroidNotification class that allow further customization of notifications that target Android devices.
  • Batch messaging APIs send_all() and send_multicast() now support sending up to 500 messages in a single call.

Version 3.1.0 - 23 October, 2019

Authentication

  • Added auth.InsufficientPermissionError type to represent operations that fail due to the credential lacking a required permission.
  • User management APIs now correctly raise auth.EmailAlreadyExistsError when an already in-use email address is specified for a user.

Cloud Messaging

  • Message class now implements the __str__() contract which can be used to obtain a string representation of a Message instance.

Version 3.0.0 - 11 September, 2019

  • Python 2.7 support is now deprecated. Developers are advised to use Python 3.4 or higher to run the Admin SDK.
  • Removed old module-level exception types auth.AuthError, db.ApiCallError, messaging.ApiCallError, instance_id.ApiCallError and project_management.ApiCallError.
  • Added a new exceptions module that defines base exception types for the entire SDK. Public APIs now raise exceptions defined in the new exceptions module (or subtypes of them). This facilitates implementing fine-grained error handling logic for a wide range of scenarios that was not supported before. See the migration guide for instructions on how to port your existing error handling code.
  • Upgraded google-cloud-firestore dependency version to to 1.14.0.
  • Upgraded google-cloud-storage dependency version to 1.18.0.

Project Management

  • IosApp, IosAppMetadata and ShaCertificate types in the project_management module have been renamed to IOSApp, IOSAppMetadata and SHACertificate respectively.

Authentication

  • It is no longer possible to delete user properties with the update_user() API by setting properties to None. Setting properties to None leaves those properties unchanged. They must be explicitly set to auth.DELETE_ATTRIBUTE to delete them.

Cloud Messaging

  • Added support for sending an image URL in notifications. Thanks cchamm for the contribution.

  • The deprecated WebpushFcmOptions type has been removed. Developers must use the PEP8 compliant type name WebpushFCMOptions instead.

Version 2.18.0 - 21 August, 2019

Cloud Messaging

  • The WebpushFcmOptions type is now deprecated. Developers should use the PEP8 compliant type name WebpushFCMOptions instead.

  • Added support for specifying the Analytics label for notifications. Thanks willawang8908 for the contribution.

  • Added support for arbitrary key-value pairs in messaging.ApsAlert. Thanks viktorasl for the contribution.

Realtime Database

  • Developers can now test Realtime Database API calls by directing the SDK traffic to the RTDB emulator. Set the FIREBASE_DATABASE_EMULATOR_HOST environment variable to specify the emulator endpoint in host:port format.

Version 2.17.0 - May 23, 2019

Firebase Cloud Messaging

Authentication

  • A new auth.DELETE_ATTRIBUTE constant that can be used with the update_user() API to remove certain attributes from user accounts. This is now the preferred way to delete attributes like display_name, photo_url and custom_claims.

Version 2.16.0 - February 21, 2019

  • The Admin SDK now automatically retries HTTP requests on all 500 and 503 errors, regardless of the HTTP method.
  • The Admin SDK no longer bundles the integration module into the release artifact.

Authentication

  • Added the email action link generation APIs for creating links for password reset, email verification and email link sign-in. See documentation for more details and code samples. Thanks hardikns for the contribution.
  • The user management API now uses the new Google Identity Toolkit REST API. Thanks hardikns for the contribution.

Version 2.15.1 - January 23, 2019

  • Implemented HTTP retries. The SDK now automatically retries HTTP calls on low-level connection and socket read errors as well as HTTP 500 and 503 errors.

Version 2.15.0 - January 16, 2019

  • Dropped support for Python 3.3. Developers on Python 3 must use 3.4 or higher. Support for Python 2.7 has not changed.
  • Declared a direct dependency on google-api-core[grpc] in order to resolve some long-standing Firestore installation problems.

Cloud Messaging

Version 2.14.0 - December 04, 2018

  • A new project_management API for managing apps in a Firebase project.
  • New list_android_apps() and list_ios_apps() methods for listing the existing apps in a project.
  • New create_android_app() and create_ios_app() methods for creating new apps in a project.
  • New AndroidApp and IosApp APIs for updating individual apps.

Realtime Database

  • Fixed a performance issue in the db.listen() API where it was taking a long time to process large RTDB nodes.
  • Fixed how the SDK handles special characters in node names.

Cloud Messaging

  • messaging.AndroidNotification type now supports specifying a channel_id when sending messages to Android O devices. Thanks chemidy for the contribution
  • Improved error handling by requesting a more verbose error response from the FCM backend service.

Authentication

  • Fixed the property UserRecord.tokens_valid_after_time so that it always returns an integer, and never returns None.

Version 2.13.0 - August 21, 2018

Realtime Database

  • The db.Reference type now provides a listen() API for receiving realtime update events from the Firebase Database. Thanks the-c0d3r and rizasif for the contributions.
  • The db.reference() method now optionally takes a URL parameter. This can be used to access multiple Firebase Realtime Database instances in the same project more easily.

Cloud Messaging

Version 2.12.0 - July 17, 2018

  • The Admin SDK can now read the Firebase/Google Cloud Platform project ID from both GCLOUD_PROJECT and GOOGLE_CLOUD_PROJECT environment variables.

Authentication

  • The Admin SDK can now create custom tokens without being initialized with service account credentials.
  • The SDK now accepts a serviceAccountId app option, which can be used to set just the client email of a service account.
  • When deployed in an environment managed by Google (e.g. Google App Engine), the SDK can auto discover a service account ID without any explicit configuration.

Version 2.11.0 - May 31, 2018

Authentication

Realtime Database

  • The Reference.update() method can now be invoked with dictionaries containing None values. Child keys with None values are deleted from the database.

Version 2.10.0 - April 12, 2018

Authentication

  • A new create_session_cookie() method for creating a session cookie from a Firebase ID token.
  • A new verify_session_cookie() method for validating a given session cookie string.
  • The auth module now caches the public key certificates used to verify ID tokens and session cookies, thus avoiding a network call everytime a credential needs to be verified.

Cloud Messaging

  • Added the mutable_content optional field to the messaging.Aps type. This can be used to set the mutable-content property when sending FCM messages to APNs targets.
  • Added support for specifying arbitrary key-value fields in the messaging.Aps type.

Version 2.9.1 - March 15, 2018

Cloud Messaging

  • Improved error handling in the messaging.send() API. Exceptions raised by this API now contain the correct error codes as defined in the documentation.
  • The messaging module now supports specifying an HTTP timeout for all egress requests. Pass the httpTimeout option to firebase_admin.initialize_app() before invoking any functions in messaging. Thanks carsongee for the contribution.

Version 2.9.0 - February 14, 2018

Cloud Messaging

Authentication

  • The verify_id_token() function now accepts an optional check_revoked parameter. When True, an additional check is performed to see whether the token has been revoked.
  • A new revoke_refresh_tokens() function to invalidate all tokens issued to a user.
  • A new tokens_valid_after_timestamp property has been added to the UserRecord class to indicate the time before which tokens are not valid.

Version 2.8.0 - January 11, 2018

Initialization

  • The initialize_app() method can now be invoked without any arguments. This initializes an app using Google Application Default Credentials, and other options loaded from the FIREBASE_CONFIG environment variable.

Realtime Database

  • The db.Reference.get() method now accepts an optional shallow argument. If set to True this causes the SDK to execute a shallow read, which does not retrieve the child node values of the current reference.

Version 2.7.0 - December 21, 2017

  • A new instance_id API that facilitates deleting instance IDs and associated user data from Firebase projects.

Version 2.6.0 - December 08, 2017

Authentication

  • Added the list_users() function to the firebase_admin.auth module. This function enables listing or iterating over all user accounts in a Firebase project.
  • Added the set_custom_user_claims() function to the firebase_admin.auth module. This function enables setting custom claims on a Firebase user. The custom claims can be accessed via that user's ID token.

Realtime Database

  • Updated the start_at(), end_at() and equal_to() methods of the db.Query class so they can accept empty string arguments.

Version 2.5.0 - November 07, 2017

Version 2.4.0 - September 21, 2017

Realtime Database

  • The db.Reference class now has a get_if_changed() method, which retrieves a database value only if the value has changed since last read.
  • The options dictionary passed to initialize_app() function can now contain an httpTimeout option, which sets the timeout (in seconds) for outbound HTTP connections started by the SDK.

Version 2.3.0 - August 30, 2017

Realtime Database

  • You can now get the ETag value of a database reference by passing etag=True to the get() method of a db.Reference object.
  • The db.Reference class now has a set_if_unchanged() method, which you can use to write to a database location only when the location has the ETag value you specify.
  • Fixed an issue with the transaction() method that prevented you from updating scalar values in a transaction.

Version 2.2.0 - August 14, 2017

Authentication

  • A new user management API that allows provisioning and managing Firebase users from Python applications. This API adds get_user(), get_user_by_email(), get_user_by_phone_number(), create_user(), update_user() and delete_dser() methods to the firebase_admin.auth module.

Realtime Database

  • The db.Reference class now exposes a transaction() method, which can be used to execute atomic updates on database references.

Version 2.1.1 - July 25, 2017

  • Constructors of Certificate and RefreshToken credential types can now be invoked with either a file path or a parsed JSON object. This facilitates the consumption of service account credentials and refresh token credentials from sources other than the local file system.
  • Better integration with the google-auth library for making authenticated HTTP requests from the SDK.

Version 2.1.0 - June 28, 2017

Version 2.0.0 - May 17, 2017

  • This SDK has been migrated from oauth2client to the new google-auth library.

Authentication

  • This SDK now supports verifying ID tokens when initialized with application default credentials.

Version 1.0.0 - April 04, 2017

Initialization

  • Implemented the firebase_admin module, which provides the initialize_app() function for initializing the SDK with a credential.
  • Implemented the firebase_admin.credentials module, which contains constructors for Certificate, ApplicationDefault and RefreshToken credential types.

Authentication

  • Implemented the firebase_admin.auth module, which provides create_custom_token() and verify_id_token() functions for minting custom authentication tokens and verifying Firebase ID tokens.