diff --git a/lib/robot.js b/lib/robot.js index 6dc691b2..ee5b0238 100644 --- a/lib/robot.js +++ b/lib/robot.js @@ -56,10 +56,11 @@ class Robot { } /** - * Authenticate as an installation and get a GitHub client that can be used - * to make API calls. + * Authenticate and get a GitHub client that can be used to make API calls. * - * **Note**: `robot.auth` is asynchronous, so it needs to be prefixed with a [`await`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) to wait for the magic to happen. + * **Note**: `robot.auth` is asynchronous, so it needs to be prefixed with a + * [`await`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) + * to wait for the magic to happen. * * @example * @@ -69,7 +70,12 @@ class Robot { * }); * }; * - * @param {number} id - ID of the installation, which can be extracted from an event: + * @param {number} [id] - ID of the installation, which can be extracted from + * `event.payload.installation.id`. If called without this parameter, the + * client wil authenticate [as the integration](https://developer.github.com/early-access/integrations/authentication/#as-an-integration) + * instead of as a specific installation, which means it can only be used for + * [integration APIs](https://developer.github.com/v3/integrations/). + * * @returns {Promise} - An authenticated GitHub API client */ async auth(id) {