FirebaseFunctions

public final classFirebaseFunctions


FirebaseFunctions lets you call Cloud Functions for Firebase.

Summary

Nested types

public static classFirebaseFunctions.Companion

Public methods

final @NonNullHttpsCallableReference

Returns a reference to the callable HTTPS trigger with the given name.

final @NonNullHttpsCallableReference

Returns a reference to the callable HTTPS trigger with the given name and call options.

final @NonNullHttpsCallableReference

Returns a reference to the callable HTTPS trigger with the provided URL.

final @NonNullHttpsCallableReference

Returns a reference to the callable HTTPS trigger with the provided URL and call options.

static final @NonNullFirebaseFunctions

Creates a Cloud Functions client with the default app.

static final @NonNullFirebaseFunctions

Creates a Cloud Functions client with the given app.

static final @NonNullFirebaseFunctions
getInstance(@NonNullString regionOrCustomDomain)

Creates a Cloud Functions client with the default app and given region or custom domain.

static final @NonNullFirebaseFunctions
getInstance(@NonNullFirebaseApp app, @NonNullString regionOrCustomDomain)

Creates a Cloud Functions client with the given app and region or custom domain.

final void
useEmulator(@NonNullString host, int port)

Modifies this FirebaseFunctions instance to communicate with the Cloud Functions emulator.

final void

This method is deprecated. Use useEmulator to connect to the emulator.

Extension functions

final @NonNullHttpsCallableReference

Returns a reference to the Callable HTTPS trigger with the given name and call options.

final @NonNullHttpsCallableReference

Returns a reference to the Callable HTTPS trigger with the given URL and call options.

Public methods

getHttpsCallable

public final @NonNullHttpsCallableReference getHttpsCallable(@NonNullString name)

Returns a reference to the callable HTTPS trigger with the given name.

getHttpsCallable

public final @NonNullHttpsCallableReference getHttpsCallable(
    @NonNullString name,
    @NonNullHttpsCallableOptions options
)

Returns a reference to the callable HTTPS trigger with the given name and call options.

getHttpsCallableFromUrl

public final @NonNullHttpsCallableReference getHttpsCallableFromUrl(@NonNullURL url)

Returns a reference to the callable HTTPS trigger with the provided URL.

getHttpsCallableFromUrl

public final @NonNullHttpsCallableReference getHttpsCallableFromUrl(
    @NonNullURL url,
    @NonNullHttpsCallableOptions options
)

Returns a reference to the callable HTTPS trigger with the provided URL and call options.

getInstance

public static final @NonNullFirebaseFunctions getInstance()

Creates a Cloud Functions client with the default app.

getInstance

public static final @NonNullFirebaseFunctions getInstance(@NonNullFirebaseApp app)

Creates a Cloud Functions client with the given app.

Parameters
@NonNullFirebaseApp app

The app for the Firebase project.

getInstance

public static final @NonNullFirebaseFunctions getInstance(@NonNullString regionOrCustomDomain)

Creates a Cloud Functions client with the default app and given region or custom domain.

Parameters
@NonNullString regionOrCustomDomain

The region or custom domain for the HTTPS trigger, such as"us-central1" or"https://mydomain.com".

getInstance

public static final @NonNullFirebaseFunctions getInstance(@NonNullFirebaseApp app, @NonNullString regionOrCustomDomain)

Creates a Cloud Functions client with the given app and region or custom domain.

Parameters
@NonNullFirebaseApp app

The app for the Firebase project.

@NonNullString regionOrCustomDomain

The region or custom domain for the HTTPS trigger, such as"us-central1" or"https://mydomain.com".

useEmulator

public final void useEmulator(@NonNullString host, int port)

Modifies this FirebaseFunctions instance to communicate with the Cloud Functions emulator.

Note: Call this method before using the instance to do any functions operations.

Parameters
@NonNullString host

the emulator host (for example, 10.0.2.2)

int port

the emulator port (for example, 5001)

Extension functions

FunctionsKt.getHttpsCallable

public final @NonNullHttpsCallableReference FunctionsKt.getHttpsCallable(
    @NonNullFirebaseFunctions receiver,
    @NonNullString name,
    @ExtensionFunctionType @NonNull Function1<@NonNullHttpsCallableOptions.BuilderUnit> init
)

Returns a reference to the Callable HTTPS trigger with the given name and call options.

FunctionsKt.getHttpsCallableFromUrl

public final @NonNullHttpsCallableReference FunctionsKt.getHttpsCallableFromUrl(
    @NonNullFirebaseFunctions receiver,
    @NonNullURL url,
    @ExtensionFunctionType @NonNull Function1<@NonNullHttpsCallableOptions.BuilderUnit> init
)

Returns a reference to the Callable HTTPS trigger with the given URL and call options.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.