FirebaseFunctions

classFirebaseFunctions


FirebaseFunctions lets you call Cloud Functions for Firebase.

Summary

Public companion functions

FirebaseFunctions

Creates a Cloud Functions client with the default app.

FirebaseFunctions

Creates a Cloud Functions client with the given app.

FirebaseFunctions
getInstance(regionOrCustomDomain: String)

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

FirebaseFunctions
getInstance(app: FirebaseApp, regionOrCustomDomain: String)

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

Public functions

HttpsCallableReference

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

HttpsCallableReference

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

HttpsCallableReference

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

HttpsCallableReference

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

Unit
useEmulator(host: String, port: Int)

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

Unit

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

Extension functions

HttpsCallableReference

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

HttpsCallableReference

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

Public companion functions

getInstance

fun getInstance(): FirebaseFunctions

Creates a Cloud Functions client with the default app.

getInstance

fun getInstance(app: FirebaseApp): FirebaseFunctions

Creates a Cloud Functions client with the given app.

Parameters
app: FirebaseApp

The app for the Firebase project.

getInstance

fun getInstance(regionOrCustomDomain: String): FirebaseFunctions

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

Parameters
regionOrCustomDomain: String

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

getInstance

fun getInstance(app: FirebaseApp, regionOrCustomDomain: String): FirebaseFunctions

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

Parameters
app: FirebaseApp

The app for the Firebase project.

regionOrCustomDomain: String

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

Public functions

getHttpsCallable

fun getHttpsCallable(name: String): HttpsCallableReference

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

getHttpsCallable

fun getHttpsCallable(name: String, options: HttpsCallableOptions): HttpsCallableReference

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

getHttpsCallableFromUrl

fun getHttpsCallableFromUrl(url: URL): HttpsCallableReference

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

getHttpsCallableFromUrl

fun getHttpsCallableFromUrl(url: URL, options: HttpsCallableOptions): HttpsCallableReference

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

useEmulator

fun useEmulator(host: String, port: Int): Unit

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
host: String

the emulator host (for example, 10.0.2.2)

port: Int

the emulator port (for example, 5001)

Extension functions

getHttpsCallable

fun FirebaseFunctions.getHttpsCallable(name: String, init: HttpsCallableOptions.Builder.()->Unit): HttpsCallableReference

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

getHttpsCallableFromUrl

fun FirebaseFunctions.getHttpsCallableFromUrl(url: URL, init: HttpsCallableOptions.Builder.()->Unit): HttpsCallableReference

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.