Add docs for getCredentials

This commit is contained in:
Johan Haals
2021-01-14 10:22:09 +01:00
parent 779734303b
commit 820430b220
@@ -204,8 +204,13 @@ export class GithubCredentialsProvider {
) {}
/**
* @returns GithubCredentials.
* @param opts
* Returns GithubCredentials for requested url.
* Consecutive calls to this method with the same url will return cached credentials.
* The shortest lifetime for a token returned is 10 minutes.
* @param opts containing the organization or repository url
* @returns {Promise} of @type {GithubCredentials}.
* @example
* const { token, headers } = await getCredentials({url: 'github.com/backstage/foobar'})
*/
async getCredentials(opts: { url: string }): Promise<GithubCredentials> {
const parsed = gitUrlParse(opts.url);