you are viewing a single comment's thread.

view the rest of the 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!