Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vonage/client-sdk

Package Overview
Dependencies
Maintainers
43
Versions
247
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vonage/client-sdk

The Client SDK is intended to provide a ready solution for developers to build Programmable Conversation applications across multiple Channels including: Messages, Voice, SIP, websockets, and App.

  • 0.2.1
  • npm
  • Socket score

Version published
Weekly downloads
4.8K
increased by4.79%
Maintainers
43
Weekly downloads
 
Created
Source

Vonage Voice SDK

The Client SDK is intended to provide a ready solution for developers to build Programmable Conversation applications across multiple Channels including: Messages, Voice, SIP, websockets, and App.

Installation

The SDK can be installed using the npm install command

npm i @vonage/client-sdk

SDK setup

With budler (webpack or vite)

import './App.css';
import { VoiceClient, ClientConfig, ConfigRegion } from '@vonage/client-sdk';
import VoiceClient, { ClientConfig, ConfigRegion } from '@vonage/client-sdk/voice'; // NextJS/Webpack users see note below

const client = new VoiceClient();

// Config is optional but recomended, default region is US
const config = new ClientConfig(ConfigRegion.US);
client.setConfig(config);

function App() {
  const createSession = async () => {
    const token = 'my-token';
    await client.createSession(token);
  };

  return <button onClick={createSession}> create session </button>;
}

export default App;
  • Node: We have a known issue with NextJS / Webpack that means the main import from @vonage/client-sdk doesn't work, however if you import from @vonage/client-sdk/voice the voice client successfully imports. we are working on a fix.

With script tag (UMD)

<!-- <script src="./node_modules/@vonage/client-sdk/dist/vonageClientSDK.js"></script> -->
<!-- <script src="https://cdn.jsdelivr.net/npm/@vonage/client-sdk@0.1.4/dist/vonageClientSDK.min.js"></script> -->
<script src="./node_modules/@vonage/client-sdk/dist/vonageClientSDK.min.js"></script>
<script>
  const token = 'some-token';
  const client = new vonageClientSDK.VoiceClient();
  const config = new vonageClientSDK.ClientConfig(
    vonageClientSDK.ConfigRegion.EU
  );
  client.setConfig(config);

  client.createSession(token).then((Session) => {});
</script>

With CDN (ES)

import {
  VoiceClient,
  ClientConfig,
  ConfigRegion
} from 'https://cdn.jsdelivr.net/npm/@vonage/client-sdk@0.1.4/dist/vonageClientSDK.esm.min.js';

const client = new VoiceClient();

// Config is optional but recomended, default region is US
const config = new ClientConfig(ConfigRegion.US);
client.setConfig(config);

const token = 'my-token';
client
  .createSession(token)
  .then((sessionId) => console.log(sessionId))
  .catch((err) => console.log(err));

Documentation and examples

Visit [vonage website] (https://developer.vonage.com/tools)

License

Copyright (c) 2023 Vonage, Inc. All rights reserved. Licensed only under the Vonage Client SDK License Agreement (the "License") located at LICENCE.

By downloading or otherwise using our software or services, you acknowledge that you have read, understand and agree to be bound by the Vonage Client SDK License Agreement and Privacy Policy.

You may not use, exercise any rights with respect to or exploit this SDK, or any modifications or derivative works thereof, except in accordance with the License.

Keywords

FAQs

Package last updated on 17 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc