Hello! I have no idea to how use fetch api with key
connectedCallback() {
fetch("https://api.spoonacular.com/recipes/random?apiKey=ec176c60db384bfdb8eb7a2b149f063b")
.then((res)=>{
return res.json()
})
3 answers
Please don't use fetch api when you need to use username/password or in your case, API key. For such cases, always use Apex to make a callout.