forked from mirrors/probot
Update auth docs
This commit is contained in:
parent
52917d346b
commit
e8aca83fc0
14
lib/robot.js
14
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<github>} - An authenticated GitHub API client
|
||||
*/
|
||||
async auth(id) {
|
||||
|
|
Loading…
Reference in New Issue