Overview
Use Telnyx for Real Time Communication embedded in your web applications.
- WebRTC is currently under development
The WebRTC product and SDK enables you to:
- Build mobile clients that embed real time communications
- Generate on-demand tokens for your clients
- Add real time video communication to your web applications
GUIDES AND EXAMPLES
Related:
WebRTC SDK
Telnyx WebRTC SDK is available for both Javascript and React-Native:
Getting Started with WebRTC' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
Requirements
WebRTC calls can be received without requiring the purchase or porting of a number. You will need:
- An API Key
- A connection of type Credential Connection
- A Credential for that connection
- A Token for authenticating to Telnyx WebRTC
Configuration and Usage
Telnyx WebRTC is enabled using Credential Connections. You can set up several connections to differentiate between use cases. A Credential Connection groups configuration for your calls, such as which codecs to use (tip: enable VP8 coded for video).
A Credential Connection will be used to set up On-demand Credentials which provide expiring telephony credentials sharing the connection configuration. A JWT (JSON Web Token) can be created for these On-demand Credentials to be used by client-facing applications using a WebRTC SDK.
Every On-demand Credential and Access Token (JWT) can be used to receive Inbound Calls using SIP addresses and for placing Outbound Calls.
To create a Credential Connection, On-demand Credentials and JWTs, use our APIs and authenticate using the API Key associated with your Mission Control account under API Keys. Find out more about authenticating with API V2 here.
WebRTC functionality can be added to your app using one of our WebRTC SDKs. For testing purposes we provide a sample application that uses our Javascript SDK. With this application you can authenticate to Telnyx WebRTC servers using either a SIP username/password or a JWT and be able to receive and place calls using audio and video.
Glossary
Term | Description |
---|---|
Credential Connection | Used to configure inbound/outbound calls for one or more credential |
Outbound Voice Profile | Used to configure outbound traffic and billing for one or more phone numbers |
On-demand Credential | An expiring SIP credential associated with a Connection, created via API. |
JWT | JSON Web Token. A standard method for representing claims (https://jwt.io/ |
Access Token (JWT) | A token associated with an On-demand Credential and used for authenticating to Telnyx WebRTC |
API Key | Secret API Key generated via Portal and used to authenticate Telnyx API calls. |
WebRTC SDK | A library used to provide RTC features to your application using Telnyx WebRTC platform. |
Guided Example
Follow our guided example to set up WebRTC SDK using JWT and place SIP calls.
JavaScript Client SDK' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
The Telnyx WebRTC Client SDK provides all the functionality you need to start making voice & video calls from a browser.
Adding Telnyx to your JavaScript client application
Include the @telnyx/webrtc
npm module as a dependency:
npm install @telnyx/webrtc --save
Then, import @telnyx/webrtc
in your application code.
import { TelnyxRTC } from '@telnyx/webrtc';
Adding Telnyx to your React application
Our @telnyx/react-client
library is the quickest way to get up and running if your application is written in React.
npm install @telnyx/react-client @telnyx/webrtc --save
See react-client on GitHub for the full usage guide.