CloudFunction interface

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:

exportinterfaceCloudFunction<EventTypeextendsCloudEvent<unknown>>

Properties

PropertyTypeDescription
__endpointManifestEndpoint
__triggerunknown

Methods

MethodDescription
run(event)(BETA) The callback passed to theCloudFunction constructor. Userun 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 theCloudFunction constructor. Userun to test a function.

Signature:

run(event:EventType):any|Promise<any>;

Parameters

ParameterTypeDescription
eventEventTypeThe 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 theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-02-14 UTC.