{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2020-05-30T05:48:15Z","object_id":{"id":1324,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_mqtt","title":"mod_mqtt","uri":"https:\/\/zotonic.com\/id\/1324"},"seq":1000000}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"subject":{"objects":[{"created":"2026-09-09T13:48:18Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:48:18Z","object_id":{"id":2563,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_frontend_developer","title":"Frontend developer","uri":"https:\/\/zotonic.com\/id\/2563"},"seq":2},{"created":"2026-09-09T13:48:18Z","object_id":{"id":2598,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_messaging_and_pubsub","title":"Messaging and publish-subscribe","uri":"https:\/\/zotonic.com\/id\/2598"},"seq":3},{"created":"2026-09-09T13:48:18Z","object_id":{"id":2624,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_wire_action","title":"Wire action","uri":"https:\/\/zotonic.com\/id\/2624"},"seq":4},{"created":"2026-09-09T13:48:18Z","object_id":{"id":2639,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_publish","title":"Publish","uri":"https:\/\/zotonic.com\/id\/2639"},"seq":5},{"created":"2026-09-09T13:48:18Z","object_id":{"id":2655,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_publish_and_subscribe","title":"Publish and subscribe","uri":"https:\/\/zotonic.com\/id\/2655"},"seq":6},{"created":"2026-09-09T13:48:18Z","object_id":{"id":2677,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_mqtt","title":"MQTT","uri":"https:\/\/zotonic.com\/id\/2677"},"seq":7}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2116,"is_a":["text","documentation","reference","template_action"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2116"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_template_action_action_publish","page_url":{"en":"https:\/\/zotonic.com\/docs\/2116\/publish","x-default":"https:\/\/zotonic.com\/docs\/2116\/publish"},"preview_url":null,"resource":{"version":4040,"pivot_location_lat":null,"title":"publish","is_authoritative":true,"body":"<p>Publishes a message on the topic tree of the current page.<\/p>\n<p>Example:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{% button text=&quot;Hello&quot; action={publish topic=&quot;some\/topic&quot; js_msg=&quot;Hello World!&quot;} %}\n<\/code><\/pre>\n<p>When clicked, the message set to the message <code>&quot;Hello World!&quot;<\/code> is published.<\/p>\n<p>Another example, now publishing a more complex message:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{% button text=&quot;hello&quot; action={publish topic=&quot;some\/topic&quot; foo=&quot;bar&quot; spam=&quot;eggs&quot;} %}\n<\/code><\/pre>\n<p>When clicked, the message set to the message <code>{foo: &quot;bar&quot;, spam: &quot;eggs&quot;}<\/code> is published.<\/p>\n<p>Prefix the topic with <code>bridge\/origin\/<\/code> to relay it to the topic tree on the server.<\/p>\n<table class=\"table\"><thead><tr><th>Argument<\/th><th>Description<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>topic<\/td><td>The topic of the message.<\/td><td><code>topic=&quot;test&quot;<\/code><\/td><\/tr><tr><td>js_msg<\/td><td>Literal javascript message to publish. Will be escaped.<\/td><td><code>js_msg=&quot;Hello World&quot;<\/code><\/td><\/tr><tr><td>&lt;key&gt;<\/td><td>A literal javascript value, will be escaped and added to object<\/td><td><code>spam=&quot;eggs&quot;<\/code><\/td><\/tr><\/tbody><\/table>","slug":"publish","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"d38e7b3efeda82bba834cfaf7d10f5192d43687993fc2f1bb0b6cee1ed6b9998","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":326,"is_a":["meta","category"],"name":"template_action","title":"Actions","uri":"https:\/\/test.zotonic.com\/id\/326"},"doc_source_path":"apps\/zotonic_mod_mqtt\/src\/actions\/action_mqtt_publish.erl","publication_start":"2023-06-24T08:17:57Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_mqtt\/src\/actions\/action_mqtt_publish.erl","pivot_location_lng":null,"doc_source_kind":"action","name":"doc_template_action_action_publish","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:48:02Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_mqtt","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"28493fb676b2d92727e68d4fba20d89c56cf8ead\n","erlang_module":"action_mqtt_publish","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-15T20:07:42Z","title_slug":"publish"},"uri":"https:\/\/zotonic.com\/id\/2116","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2116"}},"status":"ok"}