Skip to main content

Get started

To develop a new a coneferncing application using the twyng javascrit sdk, you need to download the latest version of the Twyng JavaScript SDK from here

Intergrate sdk to the application

To integrate the SDK into your application, include the following script tag:

    <script src="{{PATH}}/twyng.js"></script>

Replace PATH with the actual path where you have saved the Twyng JavaScript SDK file.

Client ID and secret

The Twyng JavaScript SDK can only be accessed using a client ID and client secret, provided by Twyng administrators upon request. It's crucial to safeguard these credentials as they grant access to the SDK's functionalities.

To ensure security, it's advised not to statically embed the client ID and client secret directly into JavaScript code. Instead, best practice involves retrieving these credentials dynamically, typically from a secure database or server-side environment. This approach enhances security by minimizing exposure and unauthorized access to sensitive information, thereby maintaining the integrity and confidentiality of your application's authentication process.

How to use Client ID and secret

You need to create a new twyng object from the Twyng class to start online conferencing. The Twyng class will be globally accessible after integrating the Twyng SDK into your project.

    const twyng = new Twyng({
clientId: 'CLIENT_ID',
apiKey: 'CLIENT_SECRET_KET',
iceServers: [
{ urls: ['stun:stun.l.google.com:19302'] }
// ...Here you can aslo add your own ice servers
]
})

Here, twyng is a newly created object. This object needs to be used for all other operations such as publishing, subscribing, and listening to events, etc. Replace CLIENT_ID and CLIENT_SECRET_KEY with your client ID and secret.

Ice Servers

Ice Servers, or Interactive Connectivity Establishment servers, are essential components in WebRTC (Web Real-Time Communication) technology. They facilitate the establishment of peer-to-peer connections between devices over the internet, enabling real-time audio, video, and data communication.

Here are some resources that provide information on how to obtain ICE servers and how to set up your own ICE server:

  1. Obtaining ICE Servers:

  2. Setting Up Your Own ICE Server:

These links should provide comprehensive guidance on both obtaining ICE servers for use in your WebRTC applications and setting up your own ICE/TURN servers if needed.