UNPKG

@archon-inc/sdk

Version:

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

17 lines (14 loc) 562 B
import { Archon } from "../Archon.js"; import { User, UserId } from "../types/user.js"; /** * Given a user id, return the user's information from the Archon authentication layer. * @param id The user id to get information for. * @returns The user's information. */ export default async function getUserInfo(id: UserId): Promise<User> { const response = await Archon.request(`/users/user/${id}`, "GET"); if (response.status !== 200) { throw new Error(`Failed to retrieve user information for user ${id}.`); } return response.data; }