functions. https
Namespace for HTTPS functions.
Class
HttpsError
To send an error from an HTTPS Callable function to a client, throw an instance of this class from your handler function.
Make sure to throw this exception at the top level of your function and not from within a callback, as that will not necessarily terminate the function with this exception.
Methods
CallableContext
CallableContext()
A CallableContext is passed to the handler for an HTTPS Callable Function created with the onCall method.
Properties
Parameter |
|
|---|---|
|
auth.uid |
string The uid from decoding and verifying a Firebase Auth ID token. Value may be null. |
|
auth.token |
firebase.auth.DecodedIdToken The result of decoding and verifying a Firebase Auth ID token. Value may be null. |
|
instanceIdToken |
string An unverified token for a Firebase Instance ID. |
|
rawRequest |
Object The raw request handled by the callable. Populates all fields in the Express Value must not be null. |
onCall
onCall(handler) returns functions.HttpsFunction
Event handler which is run every time an HTTPS Callable function is called from a Firebase client SDK.
The event handler is called with the data sent from the client, and with a
CallableContext containing metadata about the request.
Parameter |
|
|---|---|
|
handler |
function(any type, non-null functions.https.CallableContext) Event handler which is run every time an HTTPS Callable function URL is hit. The function is called with data passed from the client. The value returned from this handler, either as a Value must not be null. |
- Returns
-
non-null functions.HttpsFunctionA Cloud Function which you can export.
onRequest
onRequest(handler) returns functions.HttpsFunction
Event handler which is run every time an HTTPS URL is hit.
The event handler is called with Express
Request and
Response objects as its only arguments.
Parameter |
|
|---|---|
|
handler |
function(non-null express.Request, non-null express.Response) Event handler which is run every time an HTTPS URL is hit. The function is called with Express objects which represent the request and the response. Value must not be null. |
- Returns
-
non-null functions.HttpsFunctionA Cloud Function which you can export and deploy.


