- import all the rest submodule or a specific submodule
import { restClient } from "@polygon.io/client-js";
import { referenceClient } from "@polygon.io/client-js";
const edgeHeaders = {
'X-Polygon-Edge-ID': sampleEdgeID,
'X-Polygon-Edge-IP-Address': 192.0.2.1,
'X-Polygon-Edge-User-Agent': useragent
}
const rest = restClient("API KEY", "https://api.polygon.io");
rest.forex.previousClose("C:EURUSD", {}, { headers: edgeHeaders }).then();
const reference = referenceClient("API KEY", "https://api.polygon.io");
reference.tickers({}, { headers: edgeHeaders }).then();