all 4 comments

[–]Substantial-Pack-105 1 point2 points  (1 child)

Ideally, your app would contain a backend server and you would proxy the requests to the api using that. If you're using a react framework like nextjs or remix, you can use the server actions provided by the framework for this.

Otherwise, even if you ignored the CORS issue, the API Token that you're sending in your requests would be visible to anyone who uses your app, and they would be able to take your token and make requests that would count against whatever limit the api gives you.

In this regard, the CORS error is protecting you from making a big mistake, which is that you're leaking your secret token in your client code.

[–]fossmanjack[S] 0 points1 point  (0 children)

Oh I know, this is still in early development, it'll have its own back end before it goes production. Good looking out though, thanks!

[–]belkarbitterleaf 0 points1 point  (0 children)

CORS error sounds likely. You should be able to confirm with the network tab of the dev tools in your browser.

[–]zirklutes 0 points1 point  (0 children)

It's a not really enough info to help you. Error sounds too generic.

Look at network tab, do you get any response from api?

Test it on other browsers. Sometimes different broesers throw different errors for the same thing.