Profile
Back to NewsBack
GitHub Trending 3 min
Reader Mode
Vonage/vonage-node-sdk: Vonage API client for Node.js. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Vonage/vonage-node-sdk: Vonage API client for Node.js. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Vonage Server SDK for Node.js

!GitHub Workflow Status Codecov</a> !Latest Release Contributor Covenant</a> ![License][license]

Vonage

This is the Node.JS Server SDK for Vonage APIs. To use it you will need a Vonage account. Sign up [for free at vonage.com][signup].

For full API documentation refer to developer.vonage.com.

Installation

With NPM

npm install @vonage/server-sdk

With Yarn

yarn add @vonage/server-sdk

Constructor

const { Vonage } = require('@vonage/server-sdk');

const vonage = new Vonage(credentials, options);

Where credentials is any option from @vonage/auth, and options is any option from @vonage/server-client

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 resp = await vonage.sms.send({
    to: '15552220000',
    from: '15559992222',
    text: 'This is a test',
});

Testing

Run:

npm run test

Or to continually watch and run tests as you change the code:

npm run test-watch

Examples

See the Vonage Node Quickstarts repo.

References

You can find more information for each product below:

Supported APIs

The following is a list of Vonage APIs and whether the Node Server SDK provides support for them:

| API | API Release Status | Supported? | |-----------------------|:--------------------:|:----------:| | Account API | General Availability | ✅ | | Alerts API | General Availability | ✅ | | Application API | General Availability | ✅ | | Audit API | Beta | ✅ | | Conversation API | General Availability | ✅ | | Dispatch API | Beta | ❌ | | External Accounts API | Beta | ❌ | | Media API | Beta | ✅ | | Messages API | General Availability | ✅ | | Meetings API | Deprecated | ✅ | | Number Insight V2 API | Deprecated | ✅ | | Number Insights API | Deprecated | ✅ | | Number Management API | Deprecated | ✅ | | Pricing API | General Availability | ✅ | | Redact API | Developer Preview | ✅ | | Reports API | Beta | ✅ | | SMS API | General Availability | ✅ | | Sub Accounts | Beta | ✅ | | Users | General Availability | ✅ | | Verify API | General Availability | ✅ | | Verify v2 API | General Availability | ✅ | | Video API | General Availability | ✅ | | Voice API | General Availability | ✅ |

V2 Migrations

While most of the V2 functions have been ported into their own package, some of the functions have not been ported or were removed. Below is a list of those changes:

| V2 Function | Status | Note | |-----------------------------|:---------:|:------------------------------------------------------:| | vonage.conversion | _REMOVED_ | | | vonage.conversation | Moved | Moved To [Conversations][conversations] | | vonage.app | Moved | Moved to [Applications][applications] | | vonage.files | Moved | Move to [ServerClient][server-client] | | vonage.message | Moved | Moved to [SMS][sms] | | vonage.generateJwt | Moved | Was moved to [JWT][jwt] | | vonage.generateSignature | Moved | Was moved to [SMS][sms] and [Voice][voice] | | vonage.calls | Moved | Was moved to [Voice][voice] | | vonage.credentials | Updated | Options can be found in [Server Client][server-client] | | vonage.options | Updated | Options can be found in [Server Client][server-client] | | vonage.options.httpClient | _Removed_ | | | vonage.options.userAgent | Moved | Options can be found in [Server Client][server-client] |

For more information, check out each packages migration guide.

[accounts]: https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/accounts/README.md [applications]: https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/applications/README.md [auth]: https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md [sms]: https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/sms/README.md [server-client]: https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md [jwt]: https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/jwt/README.md [conversations]: https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/conversations/README.md [voice]: https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/voice/README.md [signup]: https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL&utm_medium=github&utm_campaign=node-server-sdk [license]: LICENSE.txt

Chat with me