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.
civic-sip-api can be installed from npm:
npm install civic-sip-api --saveconst 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"
}Copyright © 2017 Civic.com
Released under the MIT License, which can be found in the repository in LICENSE.txt.