This application shows how to connect to an OpenTok session, publish a stream, subscribe to multiple streams, archive the session, and use OpenTok SIP Interconnect with Nexmo SIP Connect and Voice API to create an audio conference with PSTN users.
- Node.js
- NPM
-
Clone this repo
-
In your terminal, run
npm install
- Create a file called
config.js
. You can copy theconfig.example.js
template that's provided in this repo. - Add the OpenTok & Nexmo credentials to your
config.js
file. The file should look something like this:
module.exports = {
apiKey: '', // OpenTok API Key
apiSecret: '', // OpenTok API Secret
nexmo: {
apiKey: '', // Nexmo API Key
apiSecret: '', // Nexmo API Secret
phoneNumber: '', // Nexmo Phone Number
},
serverUrl: '', // Your server URL
};
- In your terminal, run:
node index.js