**Signature:**

    export declare class FunctionBuilder 

## Constructors

| Constructor | Modifiers | Description |
|---|---|---|
| [(constructor)(options)](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderconstructor) |   | Constructs a new instance of the `FunctionBuilder` class |

## Properties

| Property | Modifiers | Type | Description |
|---|---|---|---|
| [analytics](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderanalytics) |   | { event: (analyticsEventType: string) =\> [analytics.AnalyticsEventBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.analytics.analyticseventbuilder#analyticsanalyticseventbuilder_class); } |   |
| [auth](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderauth) |   | { user: (userOptions?: [auth.UserOptions](https://firebase.google.com/docs/reference/functions/firebase-functions.auth.useroptions#authuseroptions_interface)) =\> [auth.UserBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.auth.userbuilder#authuserbuilder_class); } |   |
| [database](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderdatabase) |   | { instance: (instance: string) =\> [database.InstanceBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.database.instancebuilder#databaseinstancebuilder_class); ref: \<Ref extends string\>(path: Ref) =\> [database.RefBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.database.refbuilder#databaserefbuilder_class)\<Ref\>; } |   |
| [firestore](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderfirestore) |   | { document: \<Path extends string\>(path: Path) =\> [firestore.DocumentBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.firestore.documentbuilder#firestoredocumentbuilder_class)\<Path\>; namespace: (namespace: string) =\> [firestore.NamespaceBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.firestore.namespacebuilder#firestorenamespacebuilder_class); database: (database: string) =\> [firestore.DatabaseBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.firestore.databasebuilder#firestoredatabasebuilder_class); } |   |
| [https](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderhttps) |   | { onRequest: (optsOrHandler: [https.HttpsOptions](https://firebase.google.com/docs/reference/functions/firebase-functions.https.httpsoptions#httpshttpsoptions_interface) \| ((req: https.Request, resp: express.Response) =\> void \| Promise\<void\>), handler?: (req: https.Request, resp: express.Response) =\> void \| Promise\<void\>) =\> import("./cloud-functions").[HttpsFunction](https://firebase.google.com/docs/reference/functions/firebase-functions.httpsfunction#httpsfunction_interface); onCall: (handler: (data: any, context: [https.CallableContext](https://firebase.google.com/docs/reference/functions/firebase-functions.https.callablecontext#httpscallablecontext_interface)) =\> any \| Promise\<any\>) =\> import("./cloud-functions").[HttpsFunction](https://firebase.google.com/docs/reference/functions/firebase-functions.httpsfunction#httpsfunction_interface) \& import("./cloud-functions").[Runnable](https://firebase.google.com/docs/reference/functions/firebase-functions.runnable#runnable_interface)\<any\>; } |   |
| [pubsub](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderpubsub) |   | { topic: (topic: string) =\> [pubsub.TopicBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.pubsub.topicbuilder#pubsubtopicbuilder_class); schedule: (schedule: string) =\> [pubsub.ScheduleBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.pubsub.schedulebuilder#pubsubschedulebuilder_class); } |   |
| [remoteConfig](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderremoteconfig) |   | { onUpdate: (handler: (version: [remoteConfig.TemplateVersion](https://firebase.google.com/docs/reference/functions/firebase-functions.remoteconfig.templateversion#remoteconfigtemplateversion_interface), context: [EventContext](https://firebase.google.com/docs/reference/functions/firebase-functions.eventcontext#eventcontext_interface)) =\> PromiseLike\<any\> \| any) =\> import("./cloud-functions").[CloudFunction](https://firebase.google.com/docs/reference/functions/firebase-functions.cloudfunction#cloudfunction_interface)\<[remoteConfig.TemplateVersion](https://firebase.google.com/docs/reference/functions/firebase-functions.remoteconfig.templateversion#remoteconfigtemplateversion_interface)\>; } |   |
| [storage](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderstorage) |   | { bucket: (bucket?: string) =\> [storage.BucketBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.storage.bucketbuilder#storagebucketbuilder_class); object: () =\> [storage.ObjectBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.storage.objectbuilder#storageobjectbuilder_class); } |   |
| [tasks](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuildertasks) |   | { taskQueue: (options?: [tasks.TaskQueueOptions](https://firebase.google.com/docs/reference/functions/firebase-functions.tasks.taskqueueoptions#taskstaskqueueoptions_interface)) =\> [tasks.TaskQueueBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.tasks.taskqueuebuilder#taskstaskqueuebuilder_class); } |   |
| [testLab](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuildertestlab) |   | { testMatrix: () =\> [testLab.TestMatrixBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.testlab.testmatrixbuilder#testlabtestmatrixbuilder_class); } |   |

## Methods

| Method | Modifiers | Description |
|---|---|---|
| [region(regions)](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderregion) |   | Configure the regions that the function is deployed to. |
| [runWith(runtimeOptions)](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilderrunwith) |   | Configure runtime options for the function. |

## FunctionBuilder.(constructor)

Constructs a new instance of the `FunctionBuilder` class

**Signature:**

    constructor(options: DeploymentOptions);

### Parameters

| Parameter | Type | Description |
|---|---|---|
| options | [DeploymentOptions](https://firebase.google.com/docs/reference/functions/firebase-functions.deploymentoptions#deploymentoptions_interface) |   |

## FunctionBuilder.analytics

**Signature:**

    get analytics(): {
            event: (analyticsEventType: string) => analytics.AnalyticsEventBuilder;
        };

## FunctionBuilder.auth

**Signature:**

    get auth(): {
            user: (userOptions?: auth.UserOptions) => auth.UserBuilder;
        };

## FunctionBuilder.database

**Signature:**

    get database(): {
            instance: (instance: string) => database.InstanceBuilder;
            ref: <Ref extends string>(path: Ref) => database.RefBuilder<Ref>;
        };

## FunctionBuilder.firestore

**Signature:**

    get firestore(): {
            document: <Path extends string>(path: Path) => firestore.DocumentBuilder<Path>;
            namespace: (namespace: string) => firestore.NamespaceBuilder;
            database: (database: string) => firestore.DatabaseBuilder;
        };

## FunctionBuilder.https

**Signature:**

    get https(): {
            onRequest: (optsOrHandler: https.HttpsOptions | ((req: https.Request, resp: express.Response) => void | Promise<void>), handler?: (req: https.Request, resp: express.Response) => void | Promise<void>) => import("./cloud-functions").HttpsFunction;
            onCall: (handler: (data: any, context: https.CallableContext) => any | Promise<any>) => import("./cloud-functions").HttpsFunction & import("./cloud-functions").Runnable<any>;
        };

## FunctionBuilder.pubsub

**Signature:**

    get pubsub(): {
            topic: (topic: string) => pubsub.TopicBuilder;
            schedule: (schedule: string) => pubsub.ScheduleBuilder;
        };

## FunctionBuilder.remoteConfig

**Signature:**

    get remoteConfig(): {
            onUpdate: (handler: (version: remoteConfig.TemplateVersion, context: EventContext) => PromiseLike<any> | any) => import("./cloud-functions").CloudFunction<remoteConfig.TemplateVersion>;
        };

## FunctionBuilder.storage

**Signature:**

    get storage(): {
            bucket: (bucket?: string) => storage.BucketBuilder;
            object: () => storage.ObjectBuilder;
        };

## FunctionBuilder.tasks

**Signature:**

    get tasks(): {
            taskQueue: (options?: tasks.TaskQueueOptions) => tasks.TaskQueueBuilder;
        };

## FunctionBuilder.testLab

**Signature:**

    get testLab(): {
            testMatrix: () => testLab.TestMatrixBuilder;
        };

## FunctionBuilder.region()

Configure the regions that the function is deployed to.

**Signature:**

    region(...regions: Array<(typeof SUPPORTED_REGIONS)[number] | string | Expression<string> | ResetValue>): FunctionBuilder;

### Parameters

| Parameter | Type | Description |
|---|---|---|
| regions | Array\<(typeof [SUPPORTED_REGIONS](https://firebase.google.com/docs/reference/functions/firebase-functions#supported_regions))\[number\] \| string \| [Expression](https://firebase.google.com/docs/reference/functions/firebase-functions.params.expression#paramsexpression_class)\<string\> \| ResetValue\> | One or more region strings. |

**Returns:**

[FunctionBuilder](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilder_class)

### Example 1

functions.region('us-east1')

### Example 2

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

## FunctionBuilder.runWith()

Configure runtime options for the function.

**Signature:**

    runWith(runtimeOptions: RuntimeOptions): FunctionBuilder;

### Parameters

| Parameter | Type | Description |
|---|---|---|
| runtimeOptions | [RuntimeOptions](https://firebase.google.com/docs/reference/functions/firebase-functions.runtimeoptions#runtimeoptions_interface) | Object with optional fields: 1. `memory`: amount of memory to allocate to the function, possible values are: '128MB', '256MB', '512MB', '1GB', '2GB', '4GB', and '8GB'. 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](https://firebase.google.com/docs/reference/functions/firebase-functions.functionbuilder#functionbuilder_class)