---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/taskrouter/quickstart/php/agent-ui-introducing#article
headline: "Control Worker Activities using TaskRouter.js: Introducing TaskRouter.js"
description: TaskRouter.js is a JavaScript Worker library that adds Worker Activity controls and real-time event notifications to your web user interfaces over a WebSocket connection.
url: https://www.twilio.com/docs/taskrouter/quickstart/php/agent-ui-introducing
inLanguage: en
dateModified: 2026-07-06T16:59:46.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# Control Worker Activities using TaskRouter.js: Introducing TaskRouter.js

TaskRouter.js is a JavaScript Worker library that adds Worker Activity controls and event notifications to your web user interfaces.

TaskRouter.js provides methods for changing the Activity of a Worker. It also provides event callbacks that let you subscribe to important events and state changes on your Worker directly from a web-based client. TaskRouter.js handles communication to the TaskRouter infrastructure over a WebSocket connection.

For details, refer to the [TaskRouter.js Worker reference documentation](/docs/taskrouter/js-sdk-v1/workspace/worker).

Next, add a real-time agent user interface: a simplified web page that lets the Worker Alice control her current Activity state, see when her Activity state changes, and see information about new incoming calls.

[Next: Add an Agent UI to our Project »](/docs/taskrouter/quickstart/php/agent-ui-add-project)
