I have the following code that creates both a JS Twilio Client as well as a JS Twilio Worker using the JS API.
function setup(workerToken, capabilityToken) {
Twilio.Device.setup(capabilityToken, {debug: true, closeProtection: true});
const worker = new Twilio.TaskRouter.Worker(workerToken);
Twilio.Device.incoming(function (conn) {
conn.accept();
});
worker.on('reservation.created', (reservation) => {
reservation.dequeue();
});
}
According to the documentation (https://www.twilio.com/docs/api/taskrouter/worker-js#reservation-dequeue) I should be able to just dequeue the reservation and the contact_uri on Twilio for the worker should be connected to. I was successfully able to connect to another phone number but I'm wondering how to connect to my Twilio Client given my identity is "cool.beans" for example.