Hello there,
I am new to snipcart and I can’t connect to your APi, i work with Next.js and can’t find anything on the forum or the docs releated to my problem. When I make my call with getServerSideProps i get this unhandledRejectionRequest failed with status code 404. It’s seems tthat’s i’m notI am not authorized to connect however i put my secret API key like in the docs.
here my code:
const secret = Buffer.from(process.env.SNIPCART_API_ID).toString('base64');
const url = 'https://api.snipcart.com/api/products';
const config = {
headers: {
'Content-Type': 'application/json',
Authorization: `Basic${secret}`,
},
};
axios.get(url, config).then((result) => {
console.log(result);
});
Help is welcome
Thanks.