Index

Constructors

constructor

Properties

Private options

Accessors

analytics

  • get analytics(): { event: any }
  • Returns { event: any }

    • event: function
      • Select analytics events to listen to for events.

        Parameters

        • analyticsEventType: string

          Name of the analytics event type.

        Returns AnalyticsEventBuilder

auth

  • get auth(): { user: any }
  • Returns { user: any }

    • user: function
      • Handle events related to Firebase authentication users.

        Returns UserBuilder

database

  • get database(): { instance: any; ref: any }
  • Returns { instance: any; ref: any }

    • instance: function
      • Selects a database instance that will trigger the function. If omitted, will pick the default database for your project.

        The Realtime Database instance to use.

        Parameters

        • instance: string

        Returns InstanceBuilder

    • ref: function
      • Select Firebase Realtime Database Reference to listen to.

        Path of the database to listen to.

        Parameters

        • path: string

        Returns RefBuilder

firestore

  • get firestore(): { document: any }
  • Returns { document: any }

    • document: function
      • Select the Firestore document to listen to for events.

        Parameters

        • path: string

          Full database path to listen to. This includes the name of the collection that the document is a part of. For example, if the collection is named "users" and the document is named "Ada", then the path is "/users/Ada".

        Returns DocumentBuilder

https

  • get https(): { onCall: any; onRequest: any }
  • Returns { onCall: any; onRequest: any }

    • onCall: function
      • onCall(handler: (data: any, context: CallableContext) => any | Promise<any>): TriggerAnnotated & (req: Request, resp: Response) => void | Promise<void> & Runnable<any>
      • Declares a callable method for clients to call using a Firebase SDK.

        Parameters

        • handler: (data: any, context: CallableContext) => any | Promise<any>

          A method that takes a data and context and returns a value.

        Returns TriggerAnnotated & (req: Request, resp: Response) => void | Promise<void> & Runnable<any>

    • onRequest: function
      • onRequest(handler: (req: Request, resp: express.Response) => void | Promise<void>): HttpsFunction
      • Handle HTTP requests.

        Parameters

        • handler: (req: Request, resp: express.Response) => void | Promise<void>

          A function that takes a request and response object, same signature as an Express app.

            • (req: Request, resp: express.Response): void | Promise<void>
            • Parameters

              • req: Request
              • resp: express.Response

              Returns void | Promise<void>

        Returns HttpsFunction

pubsub

  • get pubsub(): { schedule: any; topic: any }
  • Returns { schedule: any; topic: any }

    • schedule: function
    • topic: function
      • Select Cloud Pub/Sub topic to listen to.

        Name of Pub/Sub topic, must belong to the same project as the function.

        Parameters

        • topic: string

        Returns TopicBuilder

remoteConfig

  • get remoteConfig(): { onUpdate: any }

storage

  • get storage(): { bucket: any; object: any }
  • Returns { bucket: any; object: any }

    • bucket: function
      • The optional bucket function allows you to choose which buckets' events to handle. This step can be bypassed by calling object() directly, which will use the default Cloud Storage for Firebase bucket.

        Name of the Google Cloud Storage bucket to listen to.

        Parameters

        • Optional bucket: string

        Returns BucketBuilder

    • object: function
      • Handle events related to Cloud Storage objects.

        Returns ObjectBuilder

testLab

  • get testLab(): { testMatrix: any }

Methods

region

  • region(...regions: Array<typeof SUPPORTED_REGIONS[number] | string>): FunctionBuilder
  • Configure the regions that the function is deployed to.

    example

    functions.region('us-east1')

    example

    functions.region('us-east1', 'us-central1')

    Parameters

    • Rest ...regions: Array<typeof SUPPORTED_REGIONS[number] | string>

      One or more region strings.

    Returns FunctionBuilder

runWith

  • Configure runtime options for the function.

    Parameters

    • runtimeOptions: RuntimeOptions

      Object with optional fields:

      1. memory: amount of memory to allocate to the function, possible values are: '128MB', '256MB', '512MB', '1GB', '2GB', and '4GB'.
      2. timeoutSeconds: timeout for the function in seconds, possible values are 0 to 540.
      3. failurePolicy: failure policy of the function, with boolean true being equivalent to providing an empty retry object.
      4. vpcConnector: id of a VPC connector in the same project and region
      5. vpcConnectorEgressSettings: when a vpcConnector is set, control which egress traffic is sent through the vpcConnector.

      Value must not be null.

    Returns FunctionBuilder