Skip to contentSkip to navigationSkip to topbar
Rate this page:

TaskRouter.js v1: Integrating TaskRouter to your browser-based applications


(information)

Info

The following documentation is for the CDN version of TaskRouter JS SDK V1(link takes you to an external page) and twilio-taskrouter-v1 on npm(link takes you to an external page).

This SDK is considered to be legacy and is not actively developed. For new integrations, we recommend you use the Twilio TaskRouter SDK v2(link takes you to an external page) which supports both Flex and TaskRouter standalone deployments.

TaskRouter's JS library allows you to interact with the entire TaskRouter REST API by a simple JS API. TaskRouter supports the initialization of three types of objects:

  • Worker
  • Workspace
  • TaskQueue

Workers use a Websocket connection to TaskRouter to receive realtime notifications of Worker Reservations and Task details. Upon receiving a notification for a reservation, a Worker can accept or reject the reservation. In addition, a Worker can dequeue a given call that was enqueued using the Enqueue TwiML verb. Workers can be used to build a contact center agent desktop application, add Worker presence to your CRM system, leverage TaskRouter for internal support desk applications, and much more.

You can use Workspaces & TaskQueues to build an administrative panel of statistics and display your workers, tasks, and task queues.

Since the entire REST API is exposed with the JS SDK, any of these entities can modify their properties or their subresource properties. For example, worker can modify their current activity, attributes, and friendly name. A workspace can fetch a given task queue and update its TargetWorkers. A workspace can also fetch its statistics or for a given task queue.

Get started using TaskRouter.js with workers by working through the TaskRouter Quickstart or reviewing the TaskRouter JS Worker API documentation.

(information)

Info

If you're working with the Twilio Flex, head over to the TaskRouter.js documentation on Github(link takes you to an external page).


Rate this page: