Skip to main content

SingleInstanceGithubCredentialsProvider.getCredentials()

Home > @backstage/integration > SingleInstanceGithubCredentialsProvider > getCredentials

Returns GithubCredentials for a given URL.

Signature:

getCredentials(opts: {
url: string;
}): Promise<GithubCredentials>;

Parameters

ParameterTypeDescription
opts{ url: string; }The organization or repository URL

Returns:

Promise<GithubCredentials>

A promise of GithubCredentials.

Remarks

Consecutive calls to this method with the same URL will return cached credentials.

The shortest lifetime for a token returned is 10 minutes.

Example

const { token, headers } = await getCredentials({
url: 'github.com/backstage/foobar'
})