1.0.1 • Published 9 months ago

nauthio v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

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

1.0.1

9 months ago

1.0.0

9 months ago