UNPKG

@clerk/shared

Version:

Internal package utils used by the Clerk SDKs

33 lines (31 loc) 813 B
import { isValidBrowser } from "./browser.mjs"; //#region src/webauthn.ts /** * */ function isWebAuthnSupported() { return typeof window !== "undefined" && isValidBrowser() && typeof window.PublicKeyCredential === "function"; } /** * */ async function isWebAuthnAutofillSupported() { try { return isWebAuthnSupported() && await window.PublicKeyCredential.isConditionalMediationAvailable(); } catch { return false; } } /** * */ async function isWebAuthnPlatformAuthenticatorSupported() { try { return typeof window !== "undefined" && await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable(); } catch { return false; } } //#endregion export { isWebAuthnAutofillSupported, isWebAuthnPlatformAuthenticatorSupported, isWebAuthnSupported }; //# sourceMappingURL=webauthn.mjs.map