FirebaseFunctions

class FirebaseFunctions


FirebaseFunctions lets you call Cloud Functions for Firebase.

Summary

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.

java-static FirebaseFunctions

Creates a Cloud Functions client with the default app.

java-static FirebaseFunctions

Creates a Cloud Functions client with the given app.

java-static FirebaseFunctions
getInstance(regionOrCustomDomain: String)

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

java-static FirebaseFunctions
getInstance(app: FirebaseApp, regionOrCustomDomain: String)

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

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

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

HttpsCallableReference

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

HttpsCallableReference

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

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.

getInstance

java-static fun getInstance(): FirebaseFunctions

Creates a Cloud Functions client with the default app.

getInstance

java-static fun getInstance(app: FirebaseApp): FirebaseFunctions

Creates a Cloud Functions client with the given app.

Parameters
app: FirebaseApp

The app for the Firebase project.

getInstance

java-static 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

java-static 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".

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)

useFunctionsEmulator

fun useFunctionsEmulator(origin: String): Unit

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.

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.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-functions-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

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.

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.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-functions-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.