Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
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 { SNBearer } from 'service-now-bearer';
or
const SNBearer = require('service-now-bearer');

How To Use

Instatiation

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 { SNBearer } 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 30 Nov 2017

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