Skip to main content

Browser-based Implementation for Calling APIs from Console in DX Portal

· 2 min read

We've added the ability to call API endpoints directly from the browser in our Developer Experience Portal for APIs. This is provided as an alternative to calling the API via our proxy.

Details

Our DX Portal for APIs has the ability to call API endpoints via the API Console. However, the API Console makes these calls using a proxy hosted at APIMatic which enabled the console to work for most of the APIs regardless of browser limitations.

We've now added an option to enable API providers to optionally use a browser-based implementation to call APIs.

You can switch to the browser-based implementation by turning off the Use Proxy flag in Docs editor:

Use Proxy flag in docs editor

Considerations

The API provider must ensure that the API supports Cross-Origin Resource Sharing (CORS). For security reasons, browsers restrict cross-origin HTTP requests initiated from within scripts unless the CORS headers are included in the response.

Making API calls from browsers using CORS places additional restrictions on the headers that can be sent in request and received in response. Please review this article on CORS to understand these limitations.

If these limitations are a problem, we suggest that not using this feature and instead relying on APIMatic's proxy.