diff --git a/lib/pubsub/topic.js b/lib/pubsub/topic.js index c3fdb839394..87938b422b0 100644 --- a/lib/pubsub/topic.js +++ b/lib/pubsub/topic.js @@ -141,6 +141,13 @@ Topic.prototype.autoCreateWrapper_ = function(method, path, q, body, callback) { * @param {function=} callback - The callback function. * * @example + * topic.publish({ + * data: 'Hello, world!' + * }, function(err, messageIds, apiResponse) {}); + * + * //- + * // The data property can be a JSON object as well. + * //- * var registerMessage = { * data: { * userId: 3, @@ -152,6 +159,7 @@ Topic.prototype.autoCreateWrapper_ = function(method, path, q, body, callback) { * hello: 'world' * } * }; + * * topic.publish(registerMessage, function(err, messageIds, apiResponse) {}); * * //-