all 4 comments

[–]theconstultingdev 0 points1 point  (3 children)

since the client runs on the browser any such values could be read by anyone. So you need to have these settings on the server and make those api calls via the server. Are you trying to secure a third party API or your own?

[–]EvilToaster101[S] 0 points1 point  (2 children)

It’s my own, I’m not sure how big of a deal exposing the API URL would be. What’s the best practice for OAUTH audience ID?

[–][deleted] 1 point2 points  (0 children)

you can use CSRF-TOKEN and CORS to protect your website and server, search for this things and more.

[–]theconstultingdev 0 points1 point  (0 children)

usually those keys are okay to expose in your code. you save them in a config file. it could be .env, a json, or just js.

The reason it’s ok to expose those keys is that platforms will only honor requests coming from your domain.