UNPKG

@archon-inc/sdk

Version:

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

15 lines (14 loc) 545 B
import { Archon } from "../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. */ export default async function getConfigValue(key) { const response = await 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; }