npm.io
1.0.51 β€’ Published 1 year ago

areyouverified

Licence
MIT
Version
1.0.51
Deps
6
Size
10 kB
Vulns
0
Weekly
0

AreYouVerified NPM Package

AreYouverified is a simple, lightweight hook to enhance your form security with verified verification.

Compatibility

The package is compatible with React. Support for additional frameworks will be added soonβ€”stay tuned

Installation

Install the package via npm or yarn:

npm install areyouverified
# or
yarn add areyouverified

Usage
  1. Import the hook:

    import { useAreYouVerified } from "areyouverified";
  2. De-structure the returned values:

    const { valid, AreYouverified } = useAreYouVerified();
  3. Integrate AreYouVerified into your form:

    const MyForm = () => {
      const { valid, AreYouverified } = useAreYouVerified();
    
      const handleSubmit = () => {
        if (valid) {
          // Proceed with form submission
          console.log("Form is verified!");
        } else {
          console.log("Please complete the verified verification.");
        }
      };
    
      return (
        <form
          onSubmit={(e) => {
            e.preventDefault();
            handleSubmit();
          }}
        >
          <AreYouverified
            theme="dark"
            customCss="validator" // Pass your CSS classes
          />
          <button type="submit">Submit</button>
        </form>
      );
    };

Features
  • AreYouVerified: A component to render the verification tool in your form.
  • valid: A boolean indicating whether the verification was successful.

Try it Out

Visit AreYouVerified Demo and check the "Give it a try" section to explore how it works.