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 🙏

© 2025 – Pkg Stats / Ryan Hefner

netsuite-oauth-client

v1.0.7

Published

NetSuite OAuth 1.0 client library for Node.js with TypeScript support

Readme

NetSuite OAuth Client 🚀

Simple and easy-to-use NetSuite OAuth library for Node.js applications. No more complex OAuth setup - just plug in your credentials and start making API calls!

Why Use This Library?

  • 🎯 Simple Setup - Just 3 lines of code to get started
  • 🔐 Secure - Handles all OAuth 1.0 complexity for you
  • 📝 TypeScript Ready - Full type support out of the box
  • 🛠️ Works Everywhere - Use with any HTTP client (axios, fetch, etc.)
  • Zero Dependencies - Lightweight and fast

Installation

npm install netsuite-oauth-client

Quick Start (3 Steps!)

Step 1: Install and Import

const { NetSuiteOAuthClient } = require("netsuite-oauth-client");
// Or with ES6/TypeScript
import { NetSuiteOAuthClient } from "netsuite-oauth-client";

Step 2: Create Client with Your Credentials

const client = new NetSuiteOAuthClient({
  accountid: "your_account_id",
  consumerkey: "your_consumer_key",
  consumersecret: "your_consumer_secret",
  tokenkey: "your_token_key",
  tokensecret: "your_token_secret",
  apibaseurl:
    "https://your-account.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql",
});

Step 3: Real-World Examples

📋 Get All Customers

import axios from "axios";
import { NetSuiteOAuthClient } from "netsuite-oauth-client";

const getOauthClient = new NetSuiteOAuthClient({
  // Your credentials here
});

async function getAllCustomers() {
  try {
    const requestOptions = client.createRequestOptions({
      url: "https://your-account.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql",
      method: "POST",
      data: {
        q: "query",
      },
      headers: {
        "Content-Type": "application/json",
        Accept: "application/json",
        Authorization: getOauthClient,
      },
    });

    const response = await axios(requestOptions);
    console.log("Customers:", response.data);
    return response.data;
  } catch (error) {
    console.error("Error:", error.message);
  }
}

getAllCustomers();

Getting Your NetSuite Credentials

Step 1: Create Integration Record

  1. Login to NetSuite
  2. Go to Setup → Integration → New
  3. Fill in:
    • Name: Your App Name
    • State: Enabled
    • Token-Based Authentication: ✅ Checked
  4. Save and copy the Consumer Key and Consumer Secret

Step 2: Create Access Token

  1. Go to Setup → Users/Roles → Access Tokens → New
  2. Select your integration
  3. Select user and role
  4. Save and copy the Token Key and Token Secret

Step 3: Find Your Account ID

  • Look at your NetSuite URL: https://[ACCOUNT-ID].app.netsuite.com
  • Or go to Setup → Company → Company Information

Step 4: Build API URL

https://[ACCOUNT-ID].suitetalk.api.netsuite.com/services/rest/platform/v1

Troubleshooting

❌ "Invalid signature" error

  • Check your consumer secret and token secret
  • Verify your account ID is correct
  • Ensure system time is accurate

❌ "Invalid token" error

  • Verify token key and token secret
  • Check if token is expired or disabled
  • Ensure user has proper role permissions

❌ "Access denied" error

  • Check user role permissions
  • Verify integration record is enabled
  • Ensure token-based authentication is enabled

❌ "Invalid URL" error

  • Check your account ID in the API base URL
  • Verify the endpoint path is correct

Need Help?

What's Next?

  • Star this repo if it helped you!
  • 🔄 Share with your team
  • 🐛 Report issues you find
  • 💡 Suggest features you need

Made with ❤️ for the NetSuite developer community