Install the SDK
0.0.8.
Keep authentication on your server
Your browser must not receive your Phonely API key. Instead:- The browser asks your application server to start a call.
- Your server authenticates the user and confirms that they may access the requested agent.
- Your server requests a short-lived web call session from Phonely using the API key.
- Your server returns the session bundle to the browser.
- The SDK uses that bundle to join the call.
Configure the browser client
SetwebCallStartEndpoint to a server route in your own application:
createWebCallStart instead of webCallStartEndpoint.
Pass runtime variables
If a flow uses runtime variables, pass their IDs and values throughmetadata.callOverrides.liveVariables:
uuid must match the runtime variable ID configured in the flow.
Use live transcripts
Enable transcript polling when the browser needs live caller and agent messages:clearTranscript() clears only the SDK’s in-memory copy; it does not delete stored call data.
Common methods
Use
on(event, handler) and off(event, handler) to manage event listeners. The exported PhonelyEvent enum includes call lifecycle, participant, message, volume, speech, transcript, progress, and error events.

