Vonage Client SDK (Legacy Nexmo Client)

9.6.1 · deprecated · verified Tue Apr 21

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.

Common errors

Warnings

Install

Imports

Quickstart

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();

view raw JSON →