Hey, I am trying to add files to IPFS by using your tutorial code and getting this error:
Error: basic auth failure: invalid project id or project secret
What I am doing wrong?
Have checked projectId and projectSecret, even add new project and no luck…
The code I’m using:
const ipfsClient = require(‘ipfs-http-client’)
const projectId = ‘1qmt…XXX’
const projectSecret = ‘c920…XXX’
const auth =
'Basic ’ + Buffer.from(projectId + ‘:’ + projectSecret).toString(‘base64’)
const client = ipfsClient({
host: ‘ipfs.infura.io’,
port: 5001,
protocol: ‘https’,
headers: {
authorization: auth
}
})
client.pin.add(‘QmeGAVddnBSnKc1DLE7DLV9uuTqo5F7QbaveTjr45JUdQn’).then((res) => {
console.log(res)
})
Thank you for your help!.