Channel class

Eventarc Channel.

Signature:

exportdeclareclassChannel

Properties

PropertyModifiersTypeDescription
allowedEventTypesstring[]List of event types allowed by this channel for publishing. Other event types are ignored.
eventarcEventarcTheEventarc service instance associated with the currentChannel.
namestringThe channel name as provided during channel creation. If it was not specifed, the default channel name is returned ('locations/us-central1/channels/firebase').

Methods

MethodModifiersDescription
publish(events)Publishes provided events to this channel. If channel was created withallowedEventTypes and event type is not on that list, the event is ignored.

Channel.allowedEventTypes

List of event types allowed by this channel for publishing. Other event types are ignored.

Signature:

readonlyallowedEventTypes?:string[];

Channel.eventarc

TheEventarc service instance associated with the currentChannel.

Signature:

geteventarc():Eventarc;

Example

varapp=channel.eventarc;

Channel.name

The channel name as provided during channel creation. If it was not specifed, the default channel name is returned ('locations/us-central1/channels/firebase').

Signature:

getname():string;

Channel.publish()

Publishes provided events to this channel. If channel was created withallowedEventTypes and event type is not on that list, the event is ignored.

Signature:

publish(events:CloudEvent|CloudEvent[]):Promise<void>;

Parameters

ParameterTypeDescription
eventsCloudEvent |CloudEvent[]CloudEvent to publish to the channel.

Returns:

Promise<void>

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 2022-07-29 UTC.