package
Retrieves the running user's GitHub authentication token. 🪙
npm install get-github-auth-tokenGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 1 packages.
8.8 kB
Includes dependencies.
Retrieves the running user's GitHub authentication token. 🪙
npm i get-github-auth-tokenimport { getGitHubAuthToken } from "get-github-auth-token";
const auth = await getGitHubAuthToken("Hello, world! 💖");
if (auth.succeeded) {
console.log("Token:", auth.token);
} else {
console.error("Oh no:", auth.error);
}getGitHubAuthToken attempts to find a GitHub auth token from the following places, in order:
process.env.GH_TOKENprocess.env.GITHUB_TOKENgh auth token as a child process💡 Using this to create a new Octokit instance? See JoshuaKGoldberg/octokit-from-auth.
See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md.
Thanks! 🪙
💝 This package was templated with
create-typescript-appusing the Bingo framework.
uncenter 🤔 |