@vonage/network-client
v1.3.1
Published
Network API Client package
Downloads
100
Maintainers
Keywords
Readme
Vonage Server SDK for Node.js
This is the Vonage Server Client SDK for Node.js used to wrap the authentication headers/signatures 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.vonage.com.
Installation
With NPM
npm install @vonage/network-client
With Yarn
yarn add @vonage/network-client
Usage
To create a client, you will need to pass in a @vonage/auth
object.
const { Auth } = require('@vonage/auth');
const { Client } = require('@vonage/network-client');
const vonageClient = new Client (new Auth({
apiKey: API_KEY,
apiSecret: API_SECRET,
applicationId: APP_ID,
privateKey: PRIVATE_KEY_PATH,
}),
options,
);
Options
options
is any option from @vonage/server-client
along with the following that are specific for the network APIs
msisdn: string
- The MSISDN (phone number) you wish to authenticate to.accessToken: string
(optional) - A pre generated Access token for making network API callsexpiresIn: string
(required ifaccessToken
is passed) - Time until the access token expires
Testing
Run:
npm run test