Skip to content

JoshuaKGoldberg/get-github-auth-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

745 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

get-github-auth-token

Retrieves the running user's GitHub authentication token. ๐Ÿช™

๐Ÿ‘ช All Contributors: 2 ๐Ÿค Code of Conduct: Kept ๐Ÿงช Coverage ๐Ÿ“ License: MIT ๐Ÿ“ฆ npm version ๐Ÿ’ช TypeScript: Strict

Usage

npm i get-github-auth-token
import { 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:

  1. process.env.GH_TOKEN
  2. Executing gh auth token as a child process

๐Ÿ’ก Using this to create a new Octokit instance? See JoshuaKGoldberg/octokit-from-auth.

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! ๐Ÿช™

Contributors

Josh Goldberg โœจ
Josh Goldberg โœจ

๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ“– ๐Ÿค” ๐Ÿš‡ ๐Ÿšง ๐Ÿ“† ๐Ÿ”ง ๐Ÿ›
uncenter
uncenter

๐Ÿค”

๐Ÿ’ This package was templated with create-typescript-app using the Bingo framework.

About

Retrieves the running user's GitHub authentication token. ๐Ÿช™

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors