$(document).ready((a) => {
connect.ChatInterface.init({
containerId: ‘root’ // This is the id of the container where you want the widget to reside
});
});
connect.ChatInterface.initiateChat({
name: customerName,
username: username,
region: ${region},
apiGatewayEndpoint: “https://${apiId}.execute-api.${region}.amazonaws.com/Prod”,
contactAttributes: JSON.stringify({
“customerName”: customerName
}),
contactFlowId: “${contactFlowId}”,
instanceId: “${instanceId}”
},successHandler, failureHandler)