0
const projectId = process.env.PROJECTKEY
const projectSecret =process.env.SECRETKEY
const auth = 'Basic' + Buffer.from(projectId + ":" + projectSecret).toString('base64')


const client = IPFSHTTPClient({
  host:'infura-ipfs.io',
  port:5001,
  protocol:'https',
  headers:{
      authorization: auth
  }
  
  
})

i removed headers object and then got error- project id required

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 22 '22 at 12:17

1 Answers1

0

You need to add a space to Basic.

Modified code:

const auth = 'Basic ' + Buffer.from(projectId + ":" + projectSecret).toString('base64')
pigrammer
  • 2,603
  • 1
  • 11
  • 24
enobeeeeee
  • 16
  • 1