← view more API documentation

api.chat.onOperatorsAvailable

Whenever any operator comes online, the given callback will be triggered.

Examples

Maybe you want to show a nice green icon whenever you have operators available to chat:

olark('api.chat.onOperatorsAvailable', function() {
    document.getElementById('chat-indicator').className = 'green-icon';
});

Discussion

Feel free to propose good uses for this method, or even drop us some suggestions for improvement! You can also join our mailing list to collaborate with other developers and get updates from us.