Skip to content

Instantly share code, notes, and snippets.

@ragog
Created April 9, 2021 13:04
Show Gist options
  • Save ragog/19e6e9eb9cd3b4ca0caba4891226d945 to your computer and use it in GitHub Desktop.
Save ragog/19e6e9eb9cd3b4ca0caba4891226d945 to your computer and use it in GitHub Desktop.
const { default: axios } = require("axios");
const AUTH_TOKEN = Buffer.from(process.env.API_KEY).toString('base64')
axios({
method: 'get',
url: 'https://api.stripe.com/v1/customers',
headers: {
'Authorization': `Basic ${AUTH_TOKEN}`,
'content-type': 'application/x-www-form-urlencoded'
},
data: 'limit=3'
}).then((response)=> {
console.log(response.data)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment