@vonage/identity-insights
v1.0.0
Published
The Identity Insights API provides real-time access to a broad range of attributes related to the carrier, subscriber, or device associated with a phone number.
Maintainers
Keywords
Readme
Vonage Identity Insights SDK for Node.js
This is the Vonage Identity Insights SDK for Node.js for use with Vonage APIs. To use it you will need a Vonage account. Sign up for free at vonage.com.
For full API documentation refer to developer.nexmo.com.
Installation
We recommend using this SDK as part of the overall @vonage/server-sdk package. Please see the main package for installation.
You can also use this SDK standalone if you only need access to just the Identity Insights API.
With NPM
npm install @vonage/identity-insightsWith Yarn
yarn add @vonage/identity-insightsUsage
Unlike the other SDK's this package is not include in the Vonage Server SDK for Node.js
import { Auth } from "@vonage/auth";
import { IdentityInsights } from "@vonage/identity-insights";
const credentials = new Auth({
applicationId: "your-application-id",
privateKey: "/path/to/your/private.key",
});
const options = {};
const clientInsights = new IdentityInsights(credentials, options);
const params = {
phone_number: "14040000000",
insights: {
format: {},
original_carrier: {},
current_carrier: {},
},
};
const resp = await clientInsights.getIdentityInsights(params);Promises
Most methods that interact with the Vonage API uses Promises. You can either resolve these yourself, or use await to wait for a response.
const params = {
phone_number: "14040000000",
insights: {
format: {},
original_carrier: {},
current_carrier: {},
},
};
const resp = await clientInsights.getIdentityInsights(params);Testing
Run:
npm run test