Usage
Use append the result of this package to your GitHub API query strings to authorise them.
Using environment variables:
const githubAuthQueryString = require('githubauthquerystring').fetch()
const githubApiURL = `https://api.github.com/some/call?${githubAuthQueryString}`
Using manual GITHUB_ACCESS_TOKEN
:
const githubAuthQueryString = require('githubauthquerystring').fetch({
GITHUB_ACCESS_TOKEN: 'value'
})
const githubApiURL = `https://api.github.com/some/call?${githubAuthQueryString}`
Using manual GITHUB_CLIENT_ID
and GITHUB_CLIENT_SECRET
:
const githubAuthQueryString = require('githubauthquerystring').fetch({
GITHUB_CLIENT_ID: 'value',
GITHUB_CLIENT_SECRET: 'value'
})
const githubApiURL = `https://api.github.com/some/call?${githubAuthQueryString}`
If the values did not exist or were not in a valid combination, then an empty string will be returned.