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 🙏

© 2024 – Pkg Stats / Ryan Hefner

netsuite-totp

v1.0.3

Published

Generate a Time-Based One-Time Passwords (TOTP) for two-factor authentication in Node.js applications.

Downloads

8

Readme

NetSuite-TOTP

Known Vulnerabilities

The NetSuite TOTP Node.js library is a robust and easy-to-use class-based module designed to facilitate the generation of Time-Based One-Time Passwords (TOTP) in Node.js applications. This toolkit has proven to be an invaluable resource in test automation initiatives, enabling the test framework to seamlessly log in with high-level access roles. Utilizing the otplib library, it allows developers to generate secure OTP tokens with configurable digits and time periods. The generated tokens are verified internally to ensure their validity before being returned, guaranteeing the generation of valid tokens in every instance.

Installation

Install the package by running the following command:

npm install netsuite-totp --save

Include and configure the library in your project. It is recommended to set up an environment file to securely store your sensitive data such as the secret key. You can use the dotenv package to help with this.

const TOTPGenerator = require('netsuite-totp');

Usage

Instantiate the TOTPGenerator class by providing the necessary 2FA secret key, the number of digits, and the time interval. If you didn't store the 2FA secret key during the initial setup, adhere to the steps below:

  • Navigate to the settings portlet on your NetSuite home dashboard.
  • Enter your existing password along with the 2FA token.
  • The reset of the 2FA is now complete, and you will receive a confirmation email notifying you of this change.
  • Log out from NetSuite and then log back in.
  • You will notice a notification indicating that NetSuite has dispatched a verification code to your email.
  • Inspect your email inbox, locate the message, and copy paste the 6-digit verification code into NetSuite before submitting the form.
  • You will be greeted with the Security Setup wizard; proceed by clicking "next".
  • On the initial step, you will observe both the QR code and the 32-digit 2FA secret key.
  • Safely document the 2FA secret key, ideally in a password manager.
  • Concurrently, initiate your authenticator app to scan the QR code displayed previously.
  • Now enter the 6-digit token produced by your authenticator application in the confirmation field.
  • If all details are accurate, you will have the option to save the newly generated backup codes displayed to you. This concludes the process.

Create a TOTP

Create a new TOTP by providing the 2FA secret key. The digits and period can be defaulted as is.

const totpToken = new TOTPGenerator({ 
    secret: 'YOUR-SECRET-KEY', 
    digits: 6, 
    period: 30
}).generateToken();

Contributing

Feel free to contribute to the development of this library by submitting issues or pull requests.

License

This project is licensed under the terms of the MIT license. Please check the LICENSE file for more information.