Solve CORS errors when making an API request from Freshworks apps

Cross-Origin Resource Sharing (CORS) is a mechanism or protocol allowing browsers opened with one website to access resources on other websites. Generally, for security reasons, browsers forbid requests that come in from cross-domain sources for security reasons. This is called the same-origin policy. However, there could be cases where you want to overcome this and access cross-domain resources, and CORS makes this possible.

How is CORS relevant for Freshworks apps?

The domain name that hosts the Freshworks apps (for example, d3h0owdjgzys62.cloudfront.net differs from the Freshworks products' domain name (for example, acme.freshdesk.com, acme.freshservice.com). So, any API requests made from the Freshworks apps to Freshworks products need CORS behavior to happen. This also applies to requests sent to third-party APIs from Freshworks apps, which occurs in every integration use case.