Call API from javascript

Hi there.
I’m writing web app and i want to call api from javascript, so i have a problem with CORS, i searched community and found this thread

But JSONP request works by creating a script tag, therefore i cannot add custom headers (Authorization).
Can i call api from client side by javascript? or i must do it from server?
Thanks!

You can work around it by supplying access_token=abc-123 parameter in the JSONP request.

Note that token exposure is considered to be insecure and SmartThings really frowns upon any access token exposure.

1 Like

thank you so much