Getting Started
To use Corsfix, add https://proxy.corsfix.com/? before your URL when making fetch requests.
// Add Corsfix URL before the API// https://proxy.corsfix.com/? + https://api.example.com/data
fetch("https://proxy.corsfix.com/?https://api.example.com/data");Basic Usage
Section titled “Basic Usage”// GET requestfetch("https://proxy.corsfix.com/?https://api.example.com/users") .then((response) => response.json()) .then((data) => console.log(data));
// POST requestfetch("https://proxy.corsfix.com/?https://api.example.com/users", { method: "POST", body: JSON.stringify({ name: "John" }), headers: { "Content-Type": "application/json", },});API Key
Section titled “API Key”You should use the domain whitelist via the dashboard. If that’s not possible for your use case, you can fall back to using an API key.
fetch("https://proxy.corsfix.com/?https://api.example.com/data", { headers: { "x-corsfix-key": "cfx_12345678", },});We discourage using API key on the client side, as it can be exposed in your source code and browser network requests.