UNPKG

@archon-inc/sdk

Version:

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

14 lines (13 loc) 432 B
import { Archon } from "../Archon.js"; /** * Retrieves a role by its name. * @param role The name of the role to retrieve. * @returns A promise resolving to the role. */ export default async function getRole(role) { const response = await Archon.request(`/policy/role/${role}`, "GET"); if (response.status !== 200) { throw new Error(`Failed to retrieve role with ID ${role}.`); } return response.data; }