diff --git a/samples/publishMessage.js b/samples/publishMessage.js
index <HASH>..<HASH> 100644
--- a/samples/publishMessage.js
+++ b/samples/publishMessage.js
@@ -52,7 +52,7 @@ function main(
     try {
       const messageId = await pubSubClient
         .topic(topicNameOrId)
-        .publish(dataBuffer);
+        .publishMessage({data: dataBuffer});
       console.log(`Message ${messageId} published.`);
     } catch (error) {
       console.error(`Received error while publishing: ${error.message}`);
samples: topic publish() method is deprecated (#<I>)

* Topic Publish method is deprecated



The `publish()` method is deprecated in favor of `publishMessage()` and the latter requires an object.



* chore: fix formatting for linter