[[["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 2023-04-18 UTC."],[],[],null,["# pubsub namespace\n\nFunctions\n---------\n\n| Function | Description |\n|-------------------------------------------------------------------------------------------------|------------------------------------------------------|\n| [onMessagePublished(topic, handler)](./firebase-functions.pubsub.md#pubsubonmessagepublished) | Handle a message being published to a Pub/Sub topic. |\n| [onMessagePublished(options, handler)](./firebase-functions.pubsub.md#pubsubonmessagepublished) | Handle a message being published to a Pub/Sub topic. |\n\nClasses\n-------\n\n| Class | Description |\n|-----------------------------------------------------------------------|--------------------------------------------------------|\n| [Message](./firebase-functions.pubsub.message.md#pubsubmessage_class) | Interface representing a Google Cloud Pub/Sub message. |\n\nInterfaces\n----------\n\n| Interface | Description |\n|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|\n| [MessagePublishedData](./firebase-functions.pubsub.messagepublisheddata.md#pubsubmessagepublisheddata_interface) | The interface published in a Pub/Sub publish subscription. |\n| [PubSubOptions](./firebase-functions.pubsub.pubsuboptions.md#pubsubpubsuboptions_interface) | PubSubOptions extend EventHandlerOptions but must include a topic. |\n\npubsub.onMessagePublished()\n---------------------------\n\nHandle a message being published to a Pub/Sub topic.\n\n**Signature:** \n\n export declare function onMessagePublished\u003cT = any\u003e(topic: string, handler: (event: CloudEvent\u003cMessagePublishedData\u003cT\u003e\u003e) =\u003e any | Promise\u003cany\u003e): CloudFunction\u003cCloudEvent\u003cMessagePublishedData\u003cT\u003e\u003e\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|\n| topic | string | The Pub/Sub topic to watch for message events. |\n| handler | (event: [CloudEvent](./firebase-functions.cloudevent.md#cloudevent_interface)\\\u003c[MessagePublishedData](./firebase-functions.pubsub.messagepublisheddata.md#pubsubmessagepublisheddata_interface)\\\u003cT\\\u003e\\\u003e) =\\\u003e any \\| Promise\\\u003cany\\\u003e | runs every time a Cloud Pub/Sub message is published |\n\n**Returns:**\n\n[CloudFunction](./firebase-functions.cloudfunction.md#cloudfunction_interface)\\\u003c[CloudEvent](./firebase-functions.cloudevent.md#cloudevent_interface)\\\u003c[MessagePublishedData](./firebase-functions.pubsub.messagepublisheddata.md#pubsubmessagepublisheddata_interface)\\\u003cT\\\u003e\\\u003e\\\u003e\n\npubsub.onMessagePublished()\n---------------------------\n\nHandle a message being published to a Pub/Sub topic.\n\n**Signature:** \n\n export declare function onMessagePublished\u003cT = any\u003e(options: PubSubOptions, handler: (event: CloudEvent\u003cMessagePublishedData\u003cT\u003e\u003e) =\u003e any | Promise\u003cany\u003e): CloudFunction\u003cCloudEvent\u003cMessagePublishedData\u003cT\u003e\u003e\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|\n| options | [PubSubOptions](./firebase-functions.pubsub.pubsuboptions.md#pubsubpubsuboptions_interface) | Option containing information (topic) for event |\n| handler | (event: [CloudEvent](./firebase-functions.cloudevent.md#cloudevent_interface)\\\u003c[MessagePublishedData](./firebase-functions.pubsub.messagepublisheddata.md#pubsubmessagepublisheddata_interface)\\\u003cT\\\u003e\\\u003e) =\\\u003e any \\| Promise\\\u003cany\\\u003e | runs every time a Cloud Pub/Sub message is published |\n\n**Returns:**\n\n[CloudFunction](./firebase-functions.cloudfunction.md#cloudfunction_interface)\\\u003c[CloudEvent](./firebase-functions.cloudevent.md#cloudevent_interface)\\\u003c[MessagePublishedData](./firebase-functions.pubsub.messagepublisheddata.md#pubsubmessagepublisheddata_interface)\\\u003cT\\\u003e\\\u003e\\\u003e"]]