# get-github-token

> prompt the user for credentials for a github oauth token

Latest version **0.0.2** (published 2014-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-github-token
pnpm add get-github-token
yarn add get-github-token
bun add get-github-token
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-03-20 |
| First published | 2014-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Chris Dickinson |
| Maintainers | chrisdickinson |
| Keywords | github, token, oauth, porcelain |

## Links

- npm: https://www.npmjs.com/package/get-github-token
- Repository: https://github.com/chrisdickinson/get-github-token
- Issues: https://github.com/chrisdickinson/get-github-token/issues
- npm.io page: https://npm.io/package/get-github-token

## Dependencies (2)

- [github](https://npm.io/package/github.md) ^0.1.14
- [promfig](https://npm.io/package/promfig.md) ^0.1.2

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-03-20
- 0.0.1 — 2014-03-20

## README

# get-github-token

Prompt the user for username/password to get a github token. Works with TFA.

![an example](https://f.cloud.github.com/assets/37303/2469021/bdd8ecf2-afea-11e3-92ce-968a3f186752.gif)

```javascript
var getToken = require('get-github-token')

getToken(['scopes'], 'note!', 'http://noteurl.com/', function(err, token) {
  // token will be a string.
})

// or pass your own github api instance!
var gh = new Github({version: '3.0.0', protocol: 'https'})

getToken(['scopes'], 'note!', 'http://noteurl.com/', gh, function(err, token) {
  // token will be a string.
})
```

## API

#### getToken(scopes, note, noteUrl[, github], ready)

```
// signature
getToken(
    scopes:Array<String>
  , note:String
  , noteUrl:String
 [, github:Github]
  , ready:Function(err:Error, token:String)
)
```

Prompts the user for username/password in order to attain a Github oauth
token. Requires a list of [scopes](https://developer.github.com/v3/oauth/#scopes),
a note string, a note url, and a callback. The callback will receive `err` or
`token`, where `token` represents a string containing the oauth token. If not
given, the `github` parameter will be a [node-github](http://npm.im/github) instance
created as a `3.0.0` API against `https` protocol.

## License

MIT

---
_Source: https://npm.io/package/get-github-token · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
