Skip to main content
Answered

Intercom API, how to fix CORS error?


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.

View original
Did this topic help you find an answer to your question?

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

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings