Skip to content

Instantly share code, notes, and snippets.

@csszen
Created April 23, 2021 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csszen/328203a4c525cd721a13d70aa86d736f to your computer and use it in GitHub Desktop.
Save csszen/328203a4c525cd721a13d70aa86d736f to your computer and use it in GitHub Desktop.
// node
fetch('https://api.github.com/rate_limit', {headers: {Authorization: 'Basic ' + Buffer.from(`csszen:${process.env.GIST_TOKEN}`).toString('base64')}}).then(r => r.json).then(console.log)
// browser
fetch('https://api.github.com/rate_limit', {headers: {Authorization: 'Basic ' + btoa(`csszen:${token}`)}}).then(r => r.json()).then(console.log)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment