diff --git a/.changeset/mean-toys-clap.md b/.changeset/mean-toys-clap.md new file mode 100644 index 0000000000..7f87151dc2 --- /dev/null +++ b/.changeset/mean-toys-clap.md @@ -0,0 +1,5 @@ +--- +"@near-js/biometric-ed25519": minor +--- + +Introducing a new util function, isPassKeyAvailable on biometric-ed25519 package diff --git a/packages/biometric-ed25519/src/index.ts b/packages/biometric-ed25519/src/index.ts index d47d7ff3b3..4076e1fb94 100644 --- a/packages/biometric-ed25519/src/index.ts +++ b/packages/biometric-ed25519/src/index.ts @@ -112,3 +112,8 @@ export const getKeys = async (username: string): Promise<[KeyPair, KeyPair]> => return [firstKeyPair, secondKeyPair]; }); }; + +// To check if current browser supports WebAuthn +export const isPassKeyAvailable = async (): Promise => { + return window.PublicKeyCredential?.isUserVerifyingPlatformAuthenticatorAvailable?.() || false; +};