nauthio

1.0.1 • Public • Published

nauthio

JavaScript Library for NetSuite Auth 1.0. This library goal is to help speed up the setup of the authentication steps needed to set Token-Based Authentication with the NetSuite ERP System.

Installation

Requirements:

  • Node.js
  • npm (Node.js package manager)
  npm install nauthio

Usage

Modular include:

    const Nauthio = require('nauthio');

Build the NetSuite Config Object which contains the authenticaion and request details

    const nsConfig = {
        url: 'https://<account>.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=100&deploy=1',
        realm: '<ACCOUNT>',
        action: 'POST',
        tokenId: '55fe716',
        tokenSecret: '9730db3',
        consumerKey: '99cf05a',
        consumerSecret: '1886909'
    };

Create a new Nauthio instance with the config object

    const auth = new Nauthio(nsConfig);

Use the method .getOAuth. It'll use the config data

    const oAuth = auth.getOAuth();

The .buildHeader() methods returns the header

    const header = auth.buildHeader(oAuth);

    const authHeader = {
    'Authorization': header,
    'Content-Type': 'application/json'
    };

Pass the header to the respective request.

Statistics

GitHub last commit (by committer)

GitHub package.json version (branch)

GitHub repo size

GitHub

GitHub language count

Social

GitHub Repo stars GitHub forks GitHub watchers

Package Sidebar

Install

npm i nauthio

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

8.12 kB

Total Files

4

Last publish

Collaborators

  • andrepintok