Properties

auth

static

object

Authentication information for the user that triggered the function. This object contains uid and token properties for authenticated users. For more detail including token keys, see the security rules reference.

For an unauthenticated user, this field is null. For event types that do not provide user information (all except Realtime Database) or for Firebase admin users, this field will not exist.

authType

static

(string or undefined)

The level of permissions for a user. Valid values are:

  • ADMIN Developer user or user authenticated via a service account.
  • USER Known user.
  • UNAUTHENTICATED Unauthenticated action
  • null For event types that do not provide user information (all except Realtime Database).

eventId

(string or undefined)

The event’s unique identifier.

eventType

(string or undefined)

Type of event. Valid values are:

  • providers/google.firebase.analytics/eventTypes/event.log
  • providers/google.firebase.database/eventTypes/ref.write
  • providers/google.firebase.database/eventTypes/ref.create
  • providers/google.firebase.database/eventTypes/ref.update
  • providers/google.firebase.database/eventTypes/ref.delete
  • providers/cloud.firestore/eventTypes/document.write
  • providers/cloud.firestore/eventTypes/document.create
  • providers/cloud.firestore/eventTypes/document.update
  • providers/cloud.firestore/eventTypes/document.delete
  • providers/firebase.auth/eventTypes/user.create
  • providers/firebase.auth/eventTypes/user.delete
  • providers/cloud.pubsub/eventTypes/topic.publish
  • providers/cloud.storage/eventTypes/object.change

params

(non-null Object or undefined)

An object containing the values of the wildcards in the path parameter provided to the ref() method for a Realtime Database trigger.

resource

(string or undefined)

The resource that emitted the event. Valid values are:

  • Analytics — projects/<projectId>/events/<analyticsEventType>
  • Realtime Database — projects/_/instances/<databaseInstance>/refs/<databasePath>
  • Storage — projects/_/buckets/<bucketName>/objects/<fileName>#<generation>
  • Authentication — projects/<projectId>
  • Pub/Sub — projects/<projectId>/topics/<topicName>

Because Realtime Database instances and Cloud Storage buckets are globally unique and not tied to the project, their resources start with projects/_. Underscore is not a valid project name.

timestamp

(string or undefined)

Timestamp for the event as an RFC 3339 string.