All Projects → twilio → twilio-client.js

twilio / twilio-client.js

Licence: other
Twilio’s Programmable Voice JavaScript SDK

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to twilio-client.js

somleng
Open Source Implementation of Twilio's REST API
Stars: ✭ 33 (-47.62%)
Mutual labels:  twilio, voice, voip
Twilio Csharp
Twilio C#/.NET Helper Library for .NET Framework 3.5+ and supported .NET Core versions
Stars: ✭ 541 (+758.73%)
Mutual labels:  twilio, voice
Twilio Java
A Java library for communicating with the Twilio REST API and generating TwiML.
Stars: ✭ 371 (+488.89%)
Mutual labels:  twilio, voice
voice
Implementation of the Discord Voice API for discord.js and other JS/TS libraries
Stars: ✭ 310 (+392.06%)
Mutual labels:  voice, voip
fonoster
🚀 The open-source alternative to Twilio
Stars: ✭ 5,072 (+7950.79%)
Mutual labels:  twilio, voip
twilio-voice-notification-app
Reference app built in ReactJS that demonstrates how to leverage Twilio Programmable Voice and Twilio SDKs to create a voice notification system.
Stars: ✭ 21 (-66.67%)
Mutual labels:  twilio, voice
Call Forwarding Node
A sample implementation of advanced call forwarding using Twilio, Node.js and Express.js.
Stars: ✭ 6 (-90.48%)
Mutual labels:  twilio, voice
univoice
Voice chat/VoIP solution for unity. P2P implementation included.
Stars: ✭ 192 (+204.76%)
Mutual labels:  voice, voip
Fonos
🚀 The open-source alternative to Twilio
Stars: ✭ 3,785 (+5907.94%)
Mutual labels:  twilio, voip
SilentServer
Silent is very lightweight, high quality - low latency voice chat for gaming. The server runs on Windows and Linux.
Stars: ✭ 52 (-17.46%)
Mutual labels:  voice, voip
useful-twilio-functions
A set of useful Twilio Functions.
Stars: ✭ 53 (-15.87%)
Mutual labels:  twilio, voice
human-call-filter
Captcha for phone calls
Stars: ✭ 41 (-34.92%)
Mutual labels:  twilio, voip
Univoice
P2P VoIP in Unity
Stars: ✭ 128 (+103.17%)
Mutual labels:  voice, voip
Gophergameserver
🏆 Feature packed, easy-to-use game server API for Go back-ends and Javascript clients. Tutorials and examples included!
Stars: ✭ 61 (-3.17%)
Mutual labels:  voice, voip
tvoip
Terminal-based P2P VoIP application (TeamSpeak-/Skype-like voice chatting over LAN or Internet)
Stars: ✭ 34 (-46.03%)
Mutual labels:  voice, voip
Routr
Routr: Next-generation SIP Server
Stars: ✭ 788 (+1150.79%)
Mutual labels:  twilio, voip
Audioswitch
An Android audio management library for real-time communication apps.
Stars: ✭ 69 (+9.52%)
Mutual labels:  twilio, voice
tgcalls
Voice chats, private incoming and outgoing calls in Telegram for Developers
Stars: ✭ 408 (+547.62%)
Mutual labels:  voice, voip
twilio-voice.js
Twilio's JavaScript Voice SDK
Stars: ✭ 21 (-66.67%)
Mutual labels:  twilio, voice
hermes-audio-server
An open source implementation of the audio server part of the Hermes protocol
Stars: ✭ 23 (-63.49%)
Mutual labels:  voice

Deprecation Notice

This repository does not contain the latest version of Twilio's Javascript Voice SDK. Although this major version will continue to be supported, it will no longer receive new features. We recommend that all users upgrade to 2.0 at their earliest convenience, in order to receive access to new features as they arrive.

Twilio's JavaScript Voice SDK 2.0 is now GA!

This repository contains an outdated version of Twilio's Javascript Client SDK. We have now released 2.0 as Generally Available. You can find the new repository containing the JavaScript Voice SDK 2.0 here.

This new major version cleans up a lot of the legacy API, such as:

  • Removing deprecated methods
  • Renaming classes and methods to be less ambiguous
  • Implementing the new features from 1.x as defaults rather than behind feature flags
  • Completely moving to the new TwilioError class which is standardized between Voice SDKs and contains much more detailed information about errors

Additionally, new features from this point onward will only be added to the 2.0 project, and not be backported to 1.x, so anyone looking to use the latest features will want to be moved to the new 2.0 API.

Existing customers can review our migration guide here.

twilio-client.js

Travis Build Status NPM

twilio-client.js allows you to add real-time voice and PSTN calling to your web apps.

Technical Support

If you need technical support, contact [email protected].

Installation

NPM

We recommend using npm to add the Client SDK as a dependency.

npm install twilio-client --save

Using this method, you can import twilio-client.js using ES Module or TypeScript syntax:

import { Device } from 'twilio-client';

Or using CommonJS:

const Device = require('twilio-client').Device;

CDN

Though not recommended, releases of twilio-client.js are also hosted on a CDN and you can include these directly in your web app using a <script> tag.

<script src="https://sdk.twilio.com/js/client/v1.14/twilio.js"></script>

Using this method, twilio-client.js will set a browser global:

const Device = Twilio.Device;

Testing

Running unit tests requires no setup aside from installation (above). You can run unit tests via:

npm run test:unit

Integration tests require some set up:

  1. If the account you want to use doesn't already have a TwiML app set up, create one using the TwiML code below.
  2. Copy config.example.yaml to config.yaml, replacing the placeholder information with valid credentials.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Client>
      <Identity>{{To}}</Identity>
      <Parameter name="duplicate" value="12345" />
      <Parameter name="duplicate" value="123456" />
      <Parameter name="custom + param" value="我不吃蛋" />
      <Parameter name="foobar" value="some + value" />
      <Parameter name="custom1" value="{{Custom1}}" />
      <Parameter name="custom2" value="{{Custom2}}" />
      <Parameter name="custom3" value="{{Custom3}}" />
    </Client>
  </Dial>
</Response>

Integration tests can be run via:

npm run test:integration

These tests will run via karma, one at a time, in your system's default Chrome and then Firefox.

Content Security Policy (CSP)

Use the following policy directives to enable CSP that is compatible with twilio-client.js.

script-src https://media.twiliocdn.com https://sdk.twilio.com
media-src mediastream https://media.twiliocdn.com https://sdk.twilio.com
connect-src https://eventgw.twilio.com wss://chunderw-vpc-gll.twilio.com https://media.twiliocdn.com https://sdk.twilio.com

If you are providing a non-default value for Device.Options.edge or Device.Options.region parameter, you need to add the Signaling URI wss://chunderw-vpc-gll-{regionId}.twilio.com in your connect-src directive where regionId is the Region ID as defined in this page. See examples below.

If Device.Options.region is us1

connect-src https://eventgw.twilio.com https://media.twiliocdn.com https://sdk.twilio.com wss://chunderw-vpc-gll-us1.twilio.com

If Device.Options.edge is ashburn

connect-src https://eventgw.twilio.com https://media.twiliocdn.com https://sdk.twilio.com wss://chunderw-vpc-gll-us1.twilio.com

If Device.Options.edge is ['ashburn', 'sydney', 'roaming']

connect-src https://eventgw.twilio.com https://media.twiliocdn.com https://sdk.twilio.com wss://chunderw-vpc-gll-us1.twilio.com wss://chunderw-vpc-gll-au1.twilio.com wss://chunderw-vpc-gll.twilio.com

If you are providing a home region grant into your Twilio access token, you need to add the insights endpoint in your connect-src directive using eventgw.{homeRegion}.twilio.com format. Below is an example if your home region grant is sg1.

connect-src https://eventgw.sg1.twilio.com wss://chunderw-vpc-gll.twilio.com https://media.twiliocdn.com https://sdk.twilio.com

License

See LICENSE.md

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].