Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

githubauthreq

bevry320MITdeprecated8.0.0TypeScript support: included

githubauthreq has been renamed to @bevry/github-api: npm uninstall 'githubauthreq' && npm install '@bevry/github-api' && open 'https://www.npmjs.com/package/@bevry/github-api'

Authorize GitHub API requests with the appropriate credentials and preferences.

api, auth, browser, es2019, github, module, node, querystring, typed, types, typescript

readme

githubauthreq

Status of the GitHub Workflow: bevry NPM version NPM downloads Dependency Status Dev Dependency Status
GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Authorize GitHub API requests with the appropriate credentials and preferences.

Usage

Complete API Documentation.

Using TypeScript:

// imports using typescript
import { fetch } from 'githubauthreq'

// fetches the GitHub API URL securely via headers authorization, so no redaction is necessary
fetch({
    pathname: `user`,
    // url, searchParams, headers, credentials = process.env as GitHubCredentials
})

Using JavaScript:

// imports with javascript
import { fetch } from 'githubauthreq'

// fetches the GitHub API URL securely via headers authorization, so no redaction is necessary
fetch({
    pathname: `user`,
    // url, searchParams, headers, credentials = process.env
})

If you wish for a more manual approach, refer to the Complete API Documentation..

Install

npm

  • Install: npm install --save githubauthreq
  • Import: import * as pkg from ('githubauthreq')
  • Require: const pkg = require('githubauthreq')

Skypack

<script type="module">
    import * as pkg from '//cdn.skypack.dev/githubauthreq@^8.0.0'
</script>

unpkg

<script type="module">
    import * as pkg from '//unpkg.com/githubauthreq@^8.0.0'
</script>

jspm

<script type="module">
    import * as pkg from '//dev.jspm.io/githubauthreq@8.0.0'
</script>

Editions

This package is published with the following editions:

  • githubauthreq/source/index.ts is TypeScript source code with Import for modules
  • githubauthreq/edition-browsers/index.js is TypeScript compiled against ES2020 for web browsers with Import for modules
  • githubauthreq aliases githubauthreq/edition-es2019/index.js
  • githubauthreq/edition-es2019/index.js is TypeScript compiled against ES2019 for Node.js 10 || 12 || 14 || 16 with Require for modules
  • githubauthreq/edition-es2019-esm/index.js is TypeScript compiled against ES2019 for Node.js 12 || 14 || 16 with Import for modules

History

Discover the release history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under:

changelog

History

v8.0.0 2021 August 4

  • getURL, getCredentialedURL, and fetch now accept a single argument, which is the same as before but now supports url and credentials properties, and if credentials is nullish then it attempts to use the environment variables

v7.0.0 2021 August 4

  • Rewrote the API, now all you have to do is use its exported fetch method in most cases

v6.4.0 2021 August 4

v6.3.0 2021 July 30

v6.2.0 2021 July 29

v6.1.0 2021 July 28

v6.0.0 2020 November 12

  • Rewrote the API to support new authorization variables, preferences, and usage

v5.19.0 2020 October 29

v5.18.0 2020 September 4

v5.17.0 2020 August 18

v5.16.0 2020 August 4

v5.15.0 2020 July 22

v5.14.1 2020 July 22

  • Fixed editions dependency being a dev dependency instead of a standard dependency (regression since v5.13.0)
  • Updated dependencies, base files, and editions using boundation

v5.14.0 2020 July 22

v5.13.0 2020 July 21

v5.12.0 2020 June 25

v5.11.0 2020 June 21

v5.10.0 2020 June 21

v5.9.0 2020 June 20

v5.8.0 2020 June 10

v5.7.0 2020 June 10

v5.6.0 2020 May 22

v5.5.0 2020 May 21

v5.4.0 2020 May 21

v5.3.0 2020 May 11

v5.2.0 2020 May 6

v5.1.1 2020 April 27

  • Correctly move cross-fetch from dependency to dev dependency

v5.1.0 2020 April 27

  • Renamed githubQueryString to getParams with b/c alias for githubQueryString, fetch, and default
  • Renamed githubAuthorizationHeader to getAuthHeader with b/c alias for githubAuthorizationHeader
  • Renamed redact to redactParams with b/c alias for redact
  • Added new getHeaders

v5.0.0 2020 March 27

  • Updated for GitHub's new authorization recommendations
    • Introduced new githubAuthorizationHeader method, and renamed fetch to githubQueryString, and removed default export
    • Renamed the package from githubauthquerystring to githubauthreq
  • Minimum required node version changed from node: >=8 to node: >=10 to keep up with mandatory ecosystem changes

v4.0.0 2020 March 27

  • Fixed for latest TypeScript
  • Updated dependencies, base files, and editions using boundation
  • Minimum required node version changed from node: >=8 to node: >=10 to keep up with mandatory ecosystem changes — not actually applied, will be applied in next major

v3.0.1 2019 December 18

  • Fixed an error in a README.md example

v3.0.0 2019 December 18

v2.3.0 2019 December 9

v2.2.0 2019 December 1

v2.1.0 2019 December 1

v2.0.0 2019 November 18

  • Updated dependencies, base files, and editions using boundation
  • Minimum required node version changed from node: >=6 to node: >=8 to keep up with mandatory ecosystem changes

v1.2.0 2019 November 13

v1.1.0 2019 November 8

v1.0.2 2018 November 15

  • Fixed documentation link

v1.0.1 2018 November 15

  • Update engines to reflect lack of Node v4 compatibility

v1.0.0 2018 November 15

  • Initial working version