Firebase Functions service.

## Functions

| Function | Description |
|---|---|
| [getFunctions(app)](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions#getfunctions_8a40afc) | Gets the [Functions](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.functions#functions_class) service for the default app or a given app.`getFunctions()` can be called with no arguments to access the default app's `Functions` service or as `getFunctions(app)` to access the `Functions` service associated with a specific app. |

## Classes

| Class | Description |
|---|---|
| [FirebaseFunctionsError](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.firebasefunctionserror#firebasefunctionserror_class) | Cloud Functions error code structure. This extends `FirebaseError`. |
| [Functions](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.functions#functions_class) | The Firebase `Functions` service interface. |
| [TaskQueue](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.taskqueue#taskqueue_class) | The `TaskQueue` interface. |

## Interfaces

| Interface | Description |
|---|---|
| [AbsoluteDelivery](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.absolutedelivery#absolutedelivery_interface) | Interface representing task options with absolute delivery. |
| [DelayDelivery](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.delaydelivery#delaydelivery_interface) | Interface representing task options with delayed delivery. |
| [TaskOptionsExperimental](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.taskoptionsexperimental#taskoptionsexperimental_interface) | Type representing experimental (beta) task options. |

## Variables

| Variable | Description |
|---|---|
| [FunctionsErrorCode](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions#functionserrorcode) | The constant mapping for valid Cloud Functions client error codes. |

## Type Aliases

| Type Alias | Description |
|---|---|
| [DeliverySchedule](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions#deliveryschedule) | Type representing delivery schedule options. `DeliverySchedule` is a union type of [DelayDelivery](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.delaydelivery#delaydelivery_interface) and [AbsoluteDelivery](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.absolutedelivery#absolutedelivery_interface) types. |
| [FunctionScope](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions#functionscope) | Type representing the scope of a function in a task queue. |
| [FunctionsErrorCode](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions#functionserrorcode) | The type definition for valid Cloud Functions client error codes. |
| [TaskOptions](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions#taskoptions) | Type representing task options. |

## getFunctions(app)

Gets the [Functions](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.functions#functions_class) service for the default app or a given app.

`getFunctions()` can be called with no arguments to access the default app's `Functions` service or as `getFunctions(app)` to access the `Functions` service associated with a specific app.

**Signature:**

    export declare function getFunctions(app?: App): Functions;

### Parameters

| Parameter | Type | Description |
|---|---|---|
| app | App | Optional app for which to return the `Functions` service. If not provided, the default `Functions` service is returned. |

**Returns:**

[Functions](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.functions#functions_class)

The default `Functions` service if no app is provided, or the `Functions` service associated with the provided app.

### Example 1

    // Get the `Functions` service for the default app
    const defaultFunctions = getFunctions();

### Example 2

    // Get the `Functions` service for a given app
    const otherFunctions = getFunctions(otherApp);

## FunctionsErrorCode

The constant mapping for valid Cloud Functions client error codes.

**Signature:**

    FunctionsErrorCode: {
        readonly ABORTED: "aborted";
        readonly INVALID_ARGUMENT: "invalid-argument";
        readonly INVALID_CREDENTIAL: "invalid-credential";
        readonly INTERNAL_ERROR: "internal-error";
        readonly FAILED_PRECONDITION: "failed-precondition";
        readonly PERMISSION_DENIED: "permission-denied";
        readonly UNAUTHENTICATED: "unauthenticated";
        readonly NOT_FOUND: "not-found";
        readonly UNKNOWN_ERROR: "unknown-error";
        readonly TASK_ALREADY_EXISTS: "task-already-exists";
    }

## DeliverySchedule

Type representing delivery schedule options. `DeliverySchedule` is a union type of [DelayDelivery](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.delaydelivery#delaydelivery_interface) and [AbsoluteDelivery](https://firebase.google.com/docs/reference/admin/node/firebase-admin.functions.absolutedelivery#absolutedelivery_interface) types.

**Signature:**

    export type DeliverySchedule = DelayDelivery | AbsoluteDelivery;

## FunctionScope

Type representing the scope of a function in a task queue.

**Signature:**

    export type FunctionScope = {
        scope: 'current';
    } | {
        scope: 'global';
    } | {
        scope: 'extension';
        instance: string;
    };

## FunctionsErrorCode

The type definition for valid Cloud Functions client error codes.

**Signature:**

    export type FunctionsErrorCode = typeof FunctionsErrorCode[keyof typeof FunctionsErrorCode];

## TaskOptions

Type representing task options.

**Signature:**

    export type TaskOptions = DeliverySchedule & TaskOptionsExperimental & {
        dispatchDeadlineSeconds?: number;
        id?: string;
        headers?: Record<string, string>;
    };