hotfudge99
07/29/2025, 2:21 PMAI Evy
07/29/2025, 2:21 PMAI Evy
07/29/2025, 2:22 PMmetadata field and dynamic variables through retell_llm_dynamic_variables in the create-web-call request [(2) ]() :
javascript
const webCallResponse = await client.call.createWebCall({
agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
metadata: {
// Your interview metadata here
deal_name: "Interview Session",
contact_info: "user@example.com"
},
retell_llm_dynamic_variables: {
customer_name: "John Doe"
}
}) ;
## Ideal Sequencing
1. **Server-side**: Call your backend endpoint which internally calls create-web-call to get the access token [(1) ]()
2. **Client-side**: Initialize the RetellWebClient :
javascript
import { RetellWebClient } from "retell-client-js-sdk";
const retellWebClient = new RetellWebClient() ;
3. Start the call immediately after receiving the access token :
javascript
await retellWebClient.startCall({
accessToken: createCallResponse.access_token,
}) ;
## Additional Configuration Options
You can configure sample rate, audio devices, and other options when starting the call :
javascript
await retellWebClient.startCall({
accessToken: createCallResponse.access_token,
sampleRate: 24000,
captureDeviceId: "default",
playbackDeviceId: "default",
emitRawAudioSamples: false,
}) ;AI Evy
07/29/2025, 2:22 PMAI Evy
07/29/2025, 2:22 PMAI Evy
07/29/2025, 2:22 PM