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:

export interface CloudFunction<EventType extends CloudEvent<unknown>> 

Methods

Method Description
run(event) (BETA) The callback passed to the CloudFunction constructor. Use run to test a function.

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.