npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eazyotp

v2.5.0

Published

email otp sdk free

Downloads

801

Readme

EazyOtp

A lightweight, free, and easy-to-use Node.js SDK for sending and verifying Email OTPs (One-Time Passwords) via the EazyOtp microservice.

🌐 Official Website: https://eazy-otp-official.vercel.app/

Installation

Install the package via npm:

npm install eazyotp

Features

  • Fast & Reliable: Connects directly to the EazyOtp microservice.
  • Built-in Validation: Automatically validates email formats before sending requests.
  • Promise-based: Uses modern Promises with async/await for seamless integration.
  • Typescript Support: The package is written in TypeScript and exports its own types.
  • Send & Verify: Comprehensive flow to request an OTP and securely verify the user-provided code.

Usage

This package is implemented as an ES Module. You can use it in your application by importing the sendOtp and verifyOtp functions.

Basic Example (Async/Await)

import { sendOtp, verifyOtp } from "eazyotp";

async function authFlow() {
  const email = "[email protected]";
  const company = "My Awesome App"; // The name of your platform to show the user
  const apiKey = "your-api-key-here"; // Your API Key for EazyOtp

  try {
    // 1. Send OTP
    const sendResponse = await sendOtp(email, company, apiKey);
    console.log("Send OTP Response:", sendResponse);

    // 2. Verify OTP
    // Normally you would receive this '123456' from the user input
    const userEnteredOtp = 123456;
    const isVerified = await verifyOtp(email, userEnteredOtp, apiKey);

    if (isVerified) {
      console.log("OTP Verified successfully!");
    } else {
      console.log("Invalid OTP.");
    }
  } catch (error) {
    console.error("Error during OTP flow:", error);
  }
}

authFlow();

Promises Example

import { sendOtp } from "eazyotp";

const email = "[email protected]";
const company = "My Awesome App";
const apiKey = "your-api-key-here";

sendOtp(email, company, apiKey)
  .then((response) => {
    console.log("Sent OTP:", response);
  })
  .catch((error) => {
    console.error("Failed to send OTP:", error);
  });

API Reference

sendOtp(email, company, apiKey)

| Parameter | Type | Description | | :-------- | :------- | :----------------------------------------------------------- | | email | string | The recipient's email address. Must be a valid email format. | | company | string | The name of your company or application sending the OTP. | | apiKey | string | Your securely generated EazyOtp API Key. |

Returns: A Promise that resolves with the server response if successful. The response object typically contains a status and a message where the message holds information about the action.

Example Response:

{
  "status": "200",
  "message": "success"
}

If an error occurs, the Promise is rejected with an error object/string.

verifyOtp(email, otp, apiKey)

| Parameter | Type | Description | | :-------- | :------- | :----------------------------------------------------------- | | email | string | The recipient's email address. Must be a valid email format. | | otp | number | The OTP code entered by the user. | | apiKey | string | Your securely generated EazyOtp API Key. |

Returns: A Promise that resolves to a boolean true if the OTP is valid and correctly verified. It resolves to false if the verification fails (e.g., wrong OTP).

If an error occurs (such as missing parameters or network errors returning a 403 status), the Promise is rejected.

Error Handling

The SDK will quickly reject the promise with an "invalid email" or "invalid parameters" string if the format is incorrect or arguments are missing. For API-related or network errors, it throws the axios error context.

License

ISC

Author

Rasid Ekbal