1.0.2 • Published 7 months ago

native-browser-otp v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

native-browser-otp

Generate TOTP and HOTP with browser's native Web Cryptography.

Very lightweight, 1.02 KiB / 0.59 KiB gzip with just one dependency.

See caniuse.com/cryptography for Browser support.

Demo

See here.

Quick start

npm install native-browser-otp
pnpm install native-browser-otp
yarn add native-browser-otp
import { totp } from "native-browser-otp";

const code = await totp(BASE_32_SECRET);