Registry / communication / nexmo-client

nexmo-client

JSON →
library9.6.1jsnpmunverified

The `nexmo-client` package provides a JavaScript SDK for integrating programmable conversation features, including in-app messaging and voice, into web and Node.js applications. While the package name is `nexmo-client`, it is functionally the predecessor to the Vonage Client SDK. The current stable version, 9.6.1, was last published over a year ago (as of 2026), indicating it is in a deprecated or maintenance state, with active development having shifted to the official `@vonage/client-sdk` package. It offers capabilities like offline message synchronization, push notifications, rich text and image support for messaging, and advanced in-app voice features such as group calling and user controls. Its primary differentiators lie in enabling robust real-time communication within applications through the Vonage API platform.

npm install nexmo-client
INSTALL
IMPORT
SIG · NEXMO-CLIENT
N
nexmo-client
communicationjavascriptv9.6.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NexmoClient
import NexmoClient from 'nexmo-client';
import { NexmoClient } from 'nexmo-client';
The primary class is typically a default export in module environments.
NexmoClient (CommonJS)
const NexmoClient = require('nexmo-client');
Standard CommonJS import pattern for Node.js environments.
NexmoClient (Browser Global)
<!-- In HTML --> <script src="node_modules/nexmo-client/dist/nexmoClient.min.js"></script> // Then access `NexmoClient` directly
import NexmoClient from 'nexmo-client';
When included via a script tag, `NexmoClient` becomes a global variable. Module imports are for bundlers/Node.js.

This quickstart demonstrates how to install the `nexmo-client` package, import the `NexmoClient` class, and perform a basic login using a JWT. It includes error handling and logs connection status, fetching existing conversations as an example of post-login interaction.

import NexmoClient from 'nexmo-client'; // Obtain a JWT from your backend for client authentication. // In a production environment, this should never be hardcoded. const JWT = process.env.VONAGE_CLIENT_SDK_JWT ?? 'YOUR_GENERATED_JWT_HERE'; async function initializeAndConnect() { if (!JWT || JWT === 'YOUR_GENERATED_JWT_HERE') { console.error('Please provide a valid JWT for authentication.'); return; } try { const client = new NexmoClient({ debug: true }); client.on('connection:status', (status) => { console.log(`Connection status changed: ${status}`); if (status === 'disconnected') { console.warn('Client disconnected. Check network or JWT validity.'); } }); console.log('Attempting to log in with JWT...'); await client.login(JWT); console.log('Successfully logged in to Vonage client SDK.'); // You can now access client features, e.g., get conversations, make calls. const conversations = await client.getConversations(); console.log(`Found ${conversations.items.length} conversations.`); } catch (error) { console.error('Failed to initialize or login:', error.message, error); } } initializeAndConnect();
Debug
Known issues
breakingThis `nexmo-client` package is deprecated. While it may still function, active development, new features, and ongoing maintenance have moved to the official `@vonage/client-sdk` package. Projects should migrate to the new package for continued support and access to the latest capabilities.
fix
Migrate your application to use the `@vonage/client-sdk` package. The API might have subtle differences, so review the `@vonage/client-sdk` documentation for migration guidance.
affects: >=9.0.0
gotchaThe package name `nexmo-client` refers to an SDK now branded as 'Vonage Client SDK'. This can cause confusion when searching for documentation or examples, which are predominantly under the 'Vonage' brand. Ensure you are referencing documentation specific to the older `nexmo-client` or consider migrating.
fix
When seeking support or documentation, search for 'Vonage Client SDK'. Be aware that examples for the newer `@vonage/client-sdk` might not be directly compatible without adjustments.
affects: >=1.0.0
gotchaThe SDK is licensed under a custom 'Vonage Client SDK License Agreement'. This is not a standard open-source license (e.g., MIT, Apache). Developers must review and comply with its specific terms and conditions, especially regarding distribution and modification.
fix
Read the `LICENSE` file within the package or on the GitHub repository carefully to understand the legal implications and obligations before using in commercial or proprietary projects.
affects: >=1.0.0
gotchaAuthentication requires a JSON Web Token (JWT) signed by your backend. Exposing the private key or generating the JWT on the client-side is a severe security vulnerability. The client-side SDK only consumes the JWT.
fix
Always generate JWTs securely on your server-side application using your Vonage API key and secret. Pass the generated JWT to your client-side application for use with `client.login(JWT)`.
affects: >=1.0.0
Errors
Common errors & fixes
NexmoClient is not defined
The `NexmoClient` object was not correctly imported or made available in the current scope. This often happens in browser environments if the script tag isn't loaded, or in module environments if `require` or `import` fails.
fix
For browser usage via script tag, ensure `nexmoClient.min.js` is loaded before your script. For module environments (Node.js, bundlers), use `import NexmoClient from 'nexmo-client';` or `const NexmoClient = require('nexmo-client');`.
Failed to authenticate: Invalid JWT
The JSON Web Token (JWT) provided to `client.login()` is either malformed, expired, incorrectly signed, or does not contain the necessary claims (e.g., `acl`, `sub`).
fix
Verify that your backend service is generating a valid, unexpired JWT with the correct Vonage application ID, private key, and standard claims (e.g., `exp`, `jti`, `iat`, `application_id`, `sub`, `acl`). Use JWT debuggers to inspect the token payload.
TypeError: NexmoClient is not a constructor
This typically occurs when the `require()` or `import` statement for `nexmo-client` does not yield the expected constructor function, often due to incorrect export handling or a mismatch between CommonJS and ESM imports.
fix
Ensure you are using the correct import syntax for your environment: `import NexmoClient from 'nexmo-client';` for ESM, or `const NexmoClient = require('nexmo-client');` for CommonJS. Avoid using named imports like `import { NexmoClient }` as the class is likely a default export.
Upgrade
Version history
9.6.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources