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

civic-sip-api

Package Overview
Dependencies
Maintainers
5
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

civic-sip-api

Server-side library for the Civic Secure Identity platform.

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

NPM version NPM downloads node version

Node.js wrapper for the Civic hosted SIP API. For best results, be sure that you're using the latest version.

Please see docs.civic.com for a more details.

Installation

civic-sip-api can be installed from npm:

npm install civic-sip-api --save

Basic Usage

const civicSip = require('civic-sip-api');

const civicClient = civicSip.newClient({
    appId: 'ABC123',
    appSecret: APP_SECRET,
    prvKey: PRV_KEY,
});

civicClient.exchangeCode(jwtToken)
    .then((userData) => {
        // store user data and userId as appropriate
        console.log('userData = ', JSON.stringify(userData, null, 4));
    }).catch((error) => {
        console.log(error);
    });

Example of data returned for a ScopeRequest of BASIC_SIGNUP

userData =  {
    "data": [
        {
            "label": "contact.personal.email",
            "value": "user.test@gmail.com",
            "isValid": true,
            "isOwner": true
        },
        {
            "label": "contact.personal.phoneNumber",
            "value": "+1 5556187380",
            "isValid": true,
            "isOwner": true
        }
    ],
    "userId": "c6d5795f8a059ez5ad29a33a60f8b402a172c3e0bbe50fd230ae8e0303609b42"
}

Proxy Usage

There is basic proxy support. The server address and port is set as a url.

rejectUnauthorized Setting this to false is optional and can be used when testing in development and needing to use a self signed cerificate. We do not recommend setting this to false in a production environment as it will compromise security.

const civicSip = require('civic-sip-api');

const civicClient = civicSip.newClient({
    appId: 'ABC123',
    appSecret: APP_SECRET,
    prvKey: PRV_KEY,
    proxy: {
      url: 'http://10.0.0.6:8080',
      rejectUnauthorized: false, // Do not make false in production
    },
});

civicClient.exchangeCode(jwtToken)
    .then((userData) => {
        // store user data and userId as appropriate
        console.log('userData = ', JSON.stringify(userData, null, 4));
    }).catch((error) => {
        console.log(error);
    });

Copyright © 2018 Civic.com

Released under the MIT License, which can be found in the repository in LICENSE.txt.

FAQs

Package last updated on 12 Feb 2021

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