{"id":22266003,"url":"https://github.com/muhdhanish/node_otp_sender","last_synced_at":"2026-02-17T11:33:13.074Z","repository":{"id":261833289,"uuid":"663992102","full_name":"MuhdHanish/node_otp_sender","owner":"MuhdHanish","description":"Node OTP Sender is a lightweight npm package for generating and sending one-time passwords (OTPs) via email using Nodemailer. It provides a simple and easy-to-use API for integrating OTP functionality into your Node.js applications.","archived":false,"fork":false,"pushed_at":"2025-02-05T14:51:17.000Z","size":30,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T11:56:00.407Z","etag":null,"topics":["html","javascript","node-package-manager","nodejs","nodemailer","npm-package","otp-generator","otp-verification","package","security"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-otp-sender","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MuhdHanish.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-08T16:15:37.000Z","updated_at":"2025-02-05T14:51:20.000Z","dependencies_parsed_at":"2024-11-08T18:05:28.549Z","dependency_job_id":"4255e7b3-9a01-4392-97f4-e9defae8665e","html_url":"https://github.com/MuhdHanish/node_otp_sender","commit_stats":null,"previous_names":["muhdhanish/node_otp_sender","muhd-hanish/otp-sender-package"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MuhdHanish/node_otp_sender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuhdHanish%2Fnode_otp_sender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuhdHanish%2Fnode_otp_sender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuhdHanish%2Fnode_otp_sender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuhdHanish%2Fnode_otp_sender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MuhdHanish","download_url":"https://codeload.github.com/MuhdHanish/node_otp_sender/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuhdHanish%2Fnode_otp_sender/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267502610,"owners_count":24098182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","javascript","node-package-manager","nodejs","nodemailer","npm-package","otp-generator","otp-verification","package","security"],"created_at":"2024-12-03T10:17:26.852Z","updated_at":"2026-02-17T11:33:08.030Z","avatar_url":"https://github.com/MuhdHanish.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node OTP Sender\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![npm Version](https://img.shields.io/npm/v/node-otp-sender.svg)](https://www.npmjs.com/package/node-otp-sender)\n\nA simple and lightweight npm package for sending one-time passwords (OTPs) via email using Nodemailer with retry functionality.\n\n## Features\n\n- Generate and send one-time passwords (OTPs) via email\n- Secure OTP generation using the `crypto` module\n- Retry sending OTP emails in case of temporary network or email server issues\n- Simple and easy to use\n- Customizable OTP length and retry behavior\n\n## Installation\n\nInstall the package using npm:\n\n```bash\nnpm install node-otp-sender\n```\n\n## Usage\n\n```typescript\nimport { nodeOtpSender } from 'node-otp-sender';\n\nconst config = {\n  senderEmail: 'your-email@example.com',\n  senderPassword: 'your-email-password',\n  recipientEmail: 'recipient-email@example.com',\n  subject: 'OTP Verification',\n  length: 4, // Length of the OTP (default is 4)\n  maxRetries: 3, // Number of retry attempts (default is 3)\n  retryDelay: 1000 // Delay between retries in milliseconds (default is 1000ms)\n};\n\nconst sendOtp = async () =\u003e {\n  try {\n    const response = await nodeOtpSender(config);\n    console.log(response);\n  } catch (error) {\n    console.error('Error:', error);\n  }\n};\n\nsendOtp();\n```\n\n## Customizing Retry Behavior\n\nYou can customize the retry behavior by adjusting the `maxRetries` and `retryDelay` parameters in the configuration object. `maxRetries` determines the maximum number of retry attempts, and `retryDelay` sets the delay between retry attempts.\n\n## Customizing OTP Length\n\nYou can specify the length of the OTP by adjusting the `length` parameter in the configuration object. The default length is set to 4 digits, but you can change it to any desired length.\n\nMake sure to replace:\n\n- `your-email@example.com` with your actual sender email.\n- `your-email-password` with the password of your sender email.\n- `recipient-email@example.com` with the recipient's email address.\n- `OTP Verification` with your desired subject.\n\n## Feedback\n\nIf you have any feedback, please reach me at [muhammedhanish11@gmail.com](mailto:muhammedhanish11@gmail.com) or connect with me on [LinkedIn](https://www.linkedin.com/in/muhdhanish/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhdhanish%2Fnode_otp_sender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhdhanish%2Fnode_otp_sender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhdhanish%2Fnode_otp_sender/lists"}