js-passcode
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

js-passcode

This is a custom element V1-based Passcode authentication.

passcode.jpg

Examples

There are some examples in "./examples" in this package.Here is the first one to get you started.

Installation

npm install js-passcode;

Usage

Add passcode element to HTML.

<js-passcode id="passcode"></js-passcode>

Perform passcode authentication with JS.

import 'js-passcode';
 
// Correct passcode
const correctPasscode = '1234';
 
// Passcode authentication
document.querySelector('#passcode').authenticate(correctPasscode, success => {
  // If the passcode is correct, the callback function argument returns true.
  if (success) alert('Authenticated Successfully');
  else alert('Authentication Failed');
});

License

MIT licensed

/js-passcode/

    Package Sidebar

    Install

    npm i js-passcode

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    336 kB

    Total Files

    14

    Last publish

    Collaborators

    • takuya-motoshima