Socket
Socket
Sign inDemoInstall

service-now-bearer

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

service-now-bearer

This is a node module that uses the servicenow api to get a bearer token to authorize client side requests.


Version published
Maintainers
1
Created
Source

Service Now Bearer Token API

This is a node module that helps with issues getting a bearer token for oauth in service now.

Prerequisites

node version 6+

Installation

Install the node package with npm install service-now-bearer

Include service-now-bearer in your route:

import * as SNBearer from 'service-now-bearer';
or
const SNBearer = require('service-now-bearer');

How To Use

Instantiation

You must pass a config object into SNBearer during module creation. The config object must resemble the following:

 {
    url: 'https://servicenow-instance.service-now.com',
    client_id: 'client id from service now CORS application setup',
    client_secret: 'client secret from service now CORS Application setup'
 }

Then you can pass the config into the service-now-bearer Constructor:

import * as from 'service-now-bearer';

let config = { ... };

let snb = new SNBearer(config);

API

  • Login SNBearer.login(username, password) returns a promise that resolves to an access_token object
  • Refresh SNBearer.refresh(refresh_token) returns a promise that resolves to a new access_token object

Testing

You can run tests by using jest

First Install Jest npm install -g jest

Second run tests or watch tests jest --watchAll or npm test

All tests are located inside of the tests folder

Keywords

FAQs

Package last updated on 10 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc