@teamhanko/hanko-frontend-sdk
Version:
A package for simplifying UI integration with the Hanko API. It is meant for use in browsers only.
32 lines (31 loc) • 985 B
TypeScript
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}
* @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>;
/**
* 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 };