CloudFunction interface
Stay organized with collections
Save and categorize content based on your preferences.
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.
A handler for CloudEvents.
Signature:
export interface CloudFunction<EventType extends CloudEvent<unknown>>
Properties
Methods
Method |
Description |
run(event) |
(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.
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 2025-02-14 UTC.
[null,null,["Last updated 2025-02-14 UTC."],[],[],null,["\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\nMethods\n\nCloudFunction.__endpoint\n\n**Signature:** \n\n __endpoint: ManifestEndpoint;\n\nCloudFunction.__trigger\n\n**Signature:** \n\n __trigger?: unknown;\n\nCloudFunction.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.\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\nParameters\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."]]