Menu

Expand
Rate this page:

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

TaskRouter's TaskRouter.js library enables you to easily add 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 allow you to subscribe to important events and state changes on your Worker directly from a Web based client. Communication to the TaskRouter infrastructure is handled via a WebSocket connection managed by TaskRouter.js

For details, refer to the complete documentation for TaskRouter.js

In the next step, we'll add a realtime "Agent" user interface - a highly simplified Web page that allows our Worker Alice to control her current Activity State, see when her Activity state has changed, and see information about new incoming calls.

Next: Add an Agent UI to our Project »

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more