@privateid/cryptonets-web-sdk-test
Version:
CryptoNets WebAssembly SDK
34 lines • 1.31 kB
JavaScript
/* eslint-disable default-param-last */
/* eslint-disable import/no-mutable-exports */
export let apiUrl = process.env.REACT_APP_API_URL;
export let orchestrationAPIUrl = process.env.REACT_APP_API_ORCHESTRATION;
export let orchestrationApiKey = process.env.REACT_APP_API_ORCHESTRATION_API_KEY;
export let apiKey = process.env.REACT_APP_API_KEY;
export let wasmUrl = process.env.REACT_APP_API_URL_WASM || process.env.REACT_APP_API_URL;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export let cacheConfig = process.env.REACT_APP_SET_CACHE ? JSON.parse(process.env.REACT_APP_SET_CACHE) : true;
export const setEnvVariables = (api_key, api_url = null, api_orchestration_url = null, wasm_url = null, cache_config, api_orchestration_api_key = null) => {
if (api_key) {
apiKey = api_key;
}
if (api_url) {
apiUrl = api_url;
}
if (api_orchestration_url) {
orchestrationAPIUrl = api_orchestration_url;
}
if (wasm_url) {
wasmUrl = wasm_url;
}
else if (!wasm_url && !wasmUrl && apiUrl) {
wasmUrl = apiUrl;
}
if (cache_config) {
cacheConfig = cache_config;
}
if (api_orchestration_api_key) {
orchestrationApiKey = api_orchestration_api_key;
}
};
//# sourceMappingURL=envUtils.js.map