[ Web Proxy ]
URL:
Viewing: https://firebase.google.com/docs/reference/functions/firebase-functions.https [Back]  [Original]

https namespace  |  Cloud Functions for Firebase Skip to main content
Overview Fundamentals AI Build Run Reference Samples
Firebase [Firebase]
Send feedback

https namespace Stay organized with collections Save and categorize content based on your preferences.

Functions

Function Description
onCall(handler) Declares a callable method for clients to call using a Firebase SDK.
onRequest(handler) Handle HTTP requests.

Classes

Class Description
HttpsError An explicit error that can be thrown from a handler to send an error to the client that called the function.

Interfaces

Interface Description
CallableContext The interface for metadata for the API as passed to the handler.
Request An express request with the wire format representation of the request body.

Type Aliases

Type Alias Description
FunctionsErrorCode The set of Firebase Functions status codes. The codes are the same at the ones exposed by gRPC.

https.onCall()

Declares a callable method for clients to call using a Firebase SDK.

Signature:

export declare function onCall(handler: (data: any, context: CallableContext) => any | Promise<any>): HttpsFunction & Runnable<any>;

Parameters

Parameter Type Description
handler (data: any, context: CallableContext) => any | Promise<any> A method that takes a data and context and returns a value.

Returns:

HttpsFunction & Runnable<any>

https.onRequest()

Handle HTTP requests.

Signature:

export declare function onRequest(handler: (req: Request, resp: express.Response) => void | Promise<void>): HttpsFunction;

Parameters

Parameter Type Description
handler (req: Request, resp: express.Response) => void | Promise<void> A function that takes a request and response object, same signature as an Express app.

Returns:

HttpsFunction

https.FunctionsErrorCode

The set of Firebase Functions status codes. The codes are the same at the ones exposed by gRPC.

Possible values:

Signature:

export type FunctionsErrorCode = "ok" | "cancelled" | "unknown" | "invalid-argument" | "deadline-exceeded" | "not-found" | "already-exists" | "permission-denied" | "resource-exhausted" | "failed-precondition" | "aborted" | "out-of-range" | "unimplemented" | "internal" | "unavailable" | "data-loss" | "unauthenticated";
Send feedback

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

Last updated 2023-04-24 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-04-24 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page