Intercom API, how to fix CORS error? | Community
Skip to main content
Answered

Intercom API, how to fix CORS error?

  • January 18, 2024
  • 2 replies
  • 868 views

I'm trying to use the Api directly on the front end, but I'm getting this CORS error strict-origin-when-cross-origin.

 

httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Authorization': 'Bearer ....',
'Access-Control-Allow-Origin': '*'
})
};

doest not Intercom apis  work in the client side?

Best answer by Nick VZ

Hi Felipe -- using our REST API on the client-side isn't supported and represents a significant security risk as the bearer token used to authenticate requests would be exposed. A CORS error is expected in this situation. The REST API should be used from your server.

2 replies

  • Employee
  • 1 reply
  • Answer
  • January 19, 2024

Hi Felipe -- using our REST API on the client-side isn't supported and represents a significant security risk as the bearer token used to authenticate requests would be exposed. A CORS error is expected in this situation. The REST API should be used from your server.


  • Author
  • New Participant
  • 1 reply
  • January 22, 2024

Ty @Nick VZ