UNPKG

@archon-inc/sdk

Version:

Integrate easily to our government platform using this SDK. More info on https://archon.inc/sdk

18 lines (17 loc) 659 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getConfigValue; const Archon_js_1 = require("../Archon.js"); /** * Accesses the Archon configurator to retrieve the value of a configuration key. * @param key The key of the configuration value to retrieve. * @returns The value of the configuration key. */ async function getConfigValue(key) { const response = await Archon_js_1.Archon.request(`/config/item/${key}`, "GET"); if (response.status !== 200) { throw new Error(`Failed to retrieve configuration value for key ${key}.`); } const data = response.data; return data.value; }