UNPKG

@causalfoundry/js-sdk

Version:

Causal Foundry WEB SDK (JS/TS)

18 lines (15 loc) 531 B
import { NetworkProxy } from './typings' import isBrowser from "is-in-browser"; import CfNetwork from './CfNetwork' export default class NetworkFactory { static getNetworkDriver(key: string): NetworkProxy { if (isBrowser) { return new CfNetwork(key) } else { // at some point we used this node-fetch here // but it did not work with legacy versions of // typescript and jest, used by one of our partners return new CfNetwork(key) } } }