Using Symbl Javascript SDK To Push Speaker Events
In this example, it establishes a connection using a phone number through PSTN, to send speaker events, generate insights, and display a summary URL with the output. You can see how to initialize the Voice SDK, connect to the endpoint, push speaker events and get the summary URL.
Throughout the documentation you'll find various references to these variable names, which you will have to replace with your values:
Key | Description |
---|---|
APP_ID | The application ID you get from the home page of the platform. |
APP_SECRET | The application secret you get from the home page of the platform. |
AUTH_TOKEN | The JWT you get after authentication with Sybml. |
DEFAULT_PHONE_NUMBER | A phone number that you want the API to connect to. Be sure to include the country code. |
EMAIL_ADDRESS | The email address you wish to send the summary email to. |
#
Getting startedThis example runs on a Node server, so we will use symbl-node
package.
Open .env
file and add your APP_ID
, APP_SECRET
, EMAIL_ADDRESS
.
#
Initialize the SDK#
Connect to Endpoint#
Set Up Configuration OptionsFirst of all let's provide phone number and endpoint type:
In case you want to use a sip
connection, you can use type: sip
and provide
SIP URI to dial in to. This should be unique for an active call/meeting in your
system. You can also provide a dtmf
code if you have one. You can find this code
on the meeting platform invite. You can leave it blank if not connecting to the meeting
platform
You can also pass a custom audioConfig
configuration object. If not provided, it uses PCMU with an 800
sample rate. If you want to provide it, you can do it like so:
#
Getting The Connection IDTo send speaker events we will need connectionId
unique to each active
connection. to get it you can simply retrieve it from connection response:
#
Sending The Speaker EventtWe can send different speaker events to our connection indicating that different speakers started speaking. That will give us more personalized insights and get a better meeting summary
In our example, we will do it by calling helper function getScheduleEvent
, which
we will review in a bit. We pass SpeakerEvent type to it by using
SpeakerEvent.types
enum from symbl-node
, passing user data and timestamp
We retrieve users just from the global array of users but in real-world example that might be user's data retrieved from the database.
In order to push event to our connection we will create an event like so:
And push it using the pushEventOnConnection
function provided by SDK:
#
Full Code Example#
Running The ExampleCreate a javascript file named app.js and copy this code into the file. Fill in the placeholder values with the proper values. Use npm to install the required libraries: npm install symbl-node. Now in the terminal run
If successful you should receive a response in the console.
info
If you have any questions or concerns about our API, you can join our Support Slack or send us an email at developer@symbl.ai