@bluefin-exchange/bluefin7k-aggregator-sdk
Version:
14 lines (13 loc) • 357 B
JavaScript
import { Config } from "./index";
export async function fetchClient(input, init) {
const headers = new Headers(init?.headers);
const apiKey = (Config.getApiKey() || "").trim();
if (apiKey) {
headers.set("apiKey", apiKey);
}
const modifiedInit = {
...init,
headers,
};
return fetch(input, modifiedInit);
}