import AuthcClient from './AuthcClient' import type { AuthcClientOptions } from './global' export { default as TKey } from './tKeyCDN' export * from './tKeyCDN' export * from './global' /** * Asynchronously creates the AuthcClient instance and calls `checkSession`. * * **Note:** There are caveats to using this in a private browser tab, which may not silently authenticae * a user on page refresh. Please see [the checkSession docs](https://authc.github.io/authc-spa-js/classes/authcclient.html#checksession) for more info. * * @param options The client options * @returns An instance of AuthcClient */ export default async function createAuthcClient(options: AuthcClientOptions) { const authc = new AuthcClient(options) try { await authc.checkSession() } catch (error) { await authc.logout({ localOnly: true, }) } return authc } export { AuthcClient } export { GenericError, AuthenticationError, TimeoutError, PopupTimeoutError, PopupCancelledError, MfaRequiredError, } from './errors' export type { LocalStorageCache, InMemoryCache } from './cache' export type { ICache, Cacheable } from './cache'