Web OTP Api - One byte Explainer
cricCode
Posted on March 22, 2024
This is a submission for DEV Challenge v24.03.20, One Byte Explainer: Browser API or Feature.
Explainer
Accelerate and Simplify OTP sign in. Modify your SMS format to have @{domain} #{otp}
on the last line. In JS invoke navigator.credentials.get().then(otp)
with options for otp. On receiving sms, browser will prompt user for access and auto fill OTP.
Additional Context
- SMS format
- Permissions are needed to run it in iframes -> Permissions
- References MDN Chrome Docs
- Working example from chrome docs -> https://web-otp.glitch.me/
💖 💪 🙅 🚩
cricCode
Posted on March 22, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.