-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update example to show feature detection #170
Comments
For passkeys and WebAuthn, we typically recommend: if ( typeof window.PublicKeyCredential !== 'undefined' ) {
// do stuff
} I vaguely remember there being a reason why we didn't use |
@RByers you can probably steal this updated example: https://digitalcredentials.dev/docs/verifier-site/requesting-cred/ |
SGTM, happy to incorporate something like this into the explainer. Putting on my queue for now, but also happy for someone else to grab it if they get to it before me. |
Now that we're back to using
navigator.credentials
, our simple feature detection mechanism ofif ('identity' in navigator)
won't work. Presumably we'd recommendif ('DigitalCredential' in window)
instead, right? Perhaps we should add this to the example in the explainer to make it clear?I know of one developer who wasn't sure how best to feature-detect our origin trial and so instead looked for a Chrome Android UA string with Chrome version >= 128. Obviously that's not what we want people doing since the API will become available on other browsers too. Our examples should document our best-practice recommendations.
The text was updated successfully, but these errors were encountered: