@clerk/shared
Version:
Internal package utils used by the Clerk SDKs
36 lines (34 loc) • 1.01 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_browser = require('./browser.js');
//#region src/webauthn.ts
/**
*
*/
function isWebAuthnSupported() {
return typeof window !== "undefined" && require_browser.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
exports.isWebAuthnAutofillSupported = isWebAuthnAutofillSupported;
exports.isWebAuthnPlatformAuthenticatorSupported = isWebAuthnPlatformAuthenticatorSupported;
exports.isWebAuthnSupported = isWebAuthnSupported;
//# sourceMappingURL=webauthn.js.map