UNPKG

@teamhanko/hanko-frontend-sdk

Version:

A package for simplifying UI integration with the Hanko API. It is meant for use in browsers only.

42 lines (41 loc) 1.24 kB
import { Client } from "./Client"; import { User } from "../flow-api/types/payload"; /** * A class to manage user information. * * @category SDK * @subcategory Clients * @extends {Client} */ declare class UserClient extends Client { /** * Fetches the current user. * * @return {Promise<User>} * @throws {UnauthorizedError} * @throws {RequestTimeoutError} * @throws {TechnicalError} * @deprecated * @see https://docs.hanko.io/api/public#tag/User-Management/operation/IsUserAuthorized * @see https://docs.hanko.io/api/public#tag/User-Management/operation/listUser */ getCurrent(): Promise<User>; /** * Fetches the current user. * * @return {Promise<User>} * @throws {UnauthorizedError} * @throws {RequestTimeoutError} * @throws {TechnicalError} */ getCurrentUser(): Promise<User>; /** * Logs out the current user and expires the existing session cookie. A valid session cookie is required to call the logout endpoint. * * @return {Promise<void>} * @throws {RequestTimeoutError} * @throws {TechnicalError} */ logout(): Promise<void>; } export { UserClient };