New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

get-github-auth-token

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-github-auth-token

Retrieves the running user's GitHub authentication token. 🪙

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

get-github-auth-token

Retrieves the running user's GitHub authentication token. 🪙

👪 All Contributors: 1 🤝 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:

  • process.env.GH_TOKEN
  • 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 ✨

💻 🖋 📖 🤔 🚇 🚧 📆 🔧 🐛

💝 This package was templated with create-typescript-app using the Bingo engine.

FAQs

Package last updated on 31 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts