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/