(BETA) The callback passed to the CloudFunction constructor. Use run to test a function.
CloudFunction.__endpoint
Signature:
__endpoint:ManifestEndpoint;
CloudFunction.__trigger
Signature:
__trigger?:unknown;
CloudFunction.run()
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
The callback passed to the CloudFunction constructor. Use run to test a function.
Signature:
run(event:EventType):any|Promise<any>;
Parameters
Parameter
Type
Description
event
EventType
The parsed event to handle.
Returns:
any | Promise<any>
Any return value. Cloud Functions awaits any promise before shutting down your function. Resolved return values are only used for unit testing purposes.
[[["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 2025-02-14 UTC."],[],[],null,["# CloudFunction interface\n\n\u003e This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\nA handler for CloudEvents.\n\n**Signature:** \n\n export interface CloudFunction\u003cEventType extends CloudEvent\u003cunknown\u003e\u003e \n\nProperties\n----------\n\n| Property | Type | Description |\n|-----------------------------------------------------------------------------|------------------|-------------|\n| [__endpoint](./firebase-functions.cloudfunction.md#cloudfunction__endpoint) | ManifestEndpoint | |\n| [__trigger](./firebase-functions.cloudfunction.md#cloudfunction__trigger) | unknown | |\n\nMethods\n-------\n\n| Method | Description |\n|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|\n| [run(event)](./firebase-functions.cloudfunction.md#cloudfunctionrun) | ***(BETA)*** The callback passed to the `CloudFunction` constructor. Use `run` to test a function. |\n\nCloudFunction.__endpoint\n------------------------\n\n**Signature:** \n\n __endpoint: ManifestEndpoint;\n\nCloudFunction.__trigger\n-----------------------\n\n**Signature:** \n\n __trigger?: unknown;\n\nCloudFunction.run()\n-------------------\n\n\u003e This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\nThe callback passed to the `CloudFunction` constructor. Use `run` to test a function.\n\n**Signature:** \n\n run(event: EventType): any | Promise\u003cany\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|-----------|-----------------------------|\n| event | EventType | The parsed event to handle. |\n\n**Returns:**\n\nany \\| Promise\\\u003cany\\\u003e\n\nAny return value. Cloud Functions awaits any promise before shutting down your function. Resolved return values are only used for unit testing purposes."]]