Update auth docs

This commit is contained in:
Brandon Keepers 2017-04-01 23:17:57 -05:00
parent 52917d346b
commit e8aca83fc0
No known key found for this signature in database
GPG Key ID: F9533396D5FACBF6
1 changed files with 10 additions and 4 deletions

View File

@ -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<github>} - An authenticated GitHub API client
*/
async auth(id) {