firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

Add new 2nd gen Firestore auth context triggers

Open blidd-google opened this issue 1 year ago • 0 comments

Auth context support has only been available for RTDB 1st gen functions — until now! The Firestore and Eventarc teams have recently added support for Firestore Cloud Events to include event actor information, adding four new event types. These changes enable us to offer four new 2nd gen Firestore trigger types whose events will additionally contain the auth context along with the existing event data:

  • onDocumentWrittenWithAuthContext
  • onDocumentUpdatedWithAuthContext
  • onDocumentCreatedWithAuthContext
  • onDocumentDeletedWithAuthContext

The API is very similar to the existing 2nd gen Firestore triggers API; however, users should take special care to avoid event loss when migrating from the original 2nd gen Firestore trigger to the auth-context trigger. See the migration guide for more details about best practices. (TODO: link migration guide when available)

blidd-google avatar Feb 01 '24 18:02 blidd-google