npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

livechatapi

v0.6.0

Published

Livechat.com API Wrapper

Downloads

158

Readme

LiveChat API

Installation

Module available through NPM and can be installed with command npm install livechatapi

Quick start

Module designed to completely repeat official API without needs to think about authentication.

var LiveChatApi = require('livechatapi').LiveChatApi;
var api = new LiveChatApi('[email protected]', 'APIKEY')
api.status.get({ group: 0 }, function(data){
  console.log(data);
});

If you need to call function with default parameters you can call it without parameters. Above function could be simplified to

api.status.get(function(data){
  console.log(data);
});

If you don't need function results you can skip callback function definition. For example new agent creation can be done with this code

api.agents.create({ login: '[email protected]', name: 'Philip J. Fry' })

API Methods List

Full description of methods parameters available at LiveChat RESTful API Documentation page.

Library has API V1 support but as this version is deprecated it's not described in list. Most part of functions calls are similar to V2. For example, list of operators could be asked with simple api.operators.list() call.

Agents

api.agents.list(parameters, callback)

Returns all LiveChat agents list.

api.agents.get(login, callback)

Return complete details of the agent for the given login.

api.agents.create(parameters, callback)

Creates a new agent in your license.

api.agents.update(login, parameters, callback)

Updates the specified agent by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

api.agents.resetApiKey(login, callback)

Reset API key for the agent with given login.

api.agents.delete(login, callback)

Removes an agent. Archived chats will not be removed, but all statistics will be lost. Agent will be notified by e-mail that the account has been deleted.

Canned Responses

api.canned_responses.list(parameters, callback)

Returns list of all currently set canned responses.

api.canned_responses.get(id, parameters, callback)

Get single canned response. id is obtained from the all canned responses list.

api.canned_responses.create(parameters, callback)

Creates a new canned response.

api.canned_responses.update(id, parameters, callback)

Updates the specified canned response by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

api.canned_responses.delete(id, callback)

Removes a canned response with the given id.

Chats

api.chats.list(parameters, callback)

Returns all ended chats.

api.chats.get(id, parameters, callback)

Returns single chat item for the given id.

api.chats.send(id, parameters, callback)

Send chat transcript to e-mail.

Goals

api.goals.list(parameters, callback)

Returns all currently set goals.

api.goals.get(id, parameters, callback)

Returns goal details for the given id.

api.goals.create(parameters, callback)

Creates new goal.

api.goals.update(id, parameters, callback)

Updates the specified goal by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

api.goals.delete(id, callback)

Removes a goal with the given id.

api.goals.mark(id, params, callback)

Mark goal as successful.

Groups

api.groups.list(parameters, callback)

Returns all created groups.

api.groups.get(id, parameters, callback)

Returns group details for the given id.

api.groups.create(parameters, callback)

Creates a new group in your license.

api.groups.update(id, parameters, callback)

Updates the specified group by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

api.groups.delete(id, callback)

Removes a group with the given id.

Reports

api.reports.getDashboardData(callback)

Returns statistics overview from last 7 days for the whole license.

api.reports.getDashboardDataForAgent(login, callback)

Returns statistics overview from last 7 days for the specified agent. Shows his ratings, number of chats and number of reached goals. login must be correct e-mail address.

api.reports.getDashboardDataForGroup(id, callback)

Returns statistics overview from last 7 days for the specified group. Shows ratings, number of chats and reached goals. id is obtained from all groups list.

api.reports.getChatsReport(params, callback)

Shows how many chats and missed chats (offline messages) occurred during the specified period.

api.reports.getRatingsReport(params, callback)

Shows how many chats were rated and how they have been rated during specified period.

api.reports.getRatingsRanking(params, callback)

Shows the ratio of good to bad ratings for each operator.

api.reports.getQueuedVisitorsReport(params, callback)

Shows how many visitors were waiting in the queue, how many abandoned the queue or proceeded to chats.

api.reports.getQueueWaitingTimesReport(params, callback)

Shows Minimum, Average and Maximum waiting time.

api.reports.getAvailabilityReport(params, callback)

Shows how much the agent (or group or whole account) was available for chatting during specified period. When querying for one day results are shown in minutes per every hour, otherwise in hours for each day.

api.reports.getChattingTimeReport(params, callback)

Shows how much time the agent (or group) spent on chatting during specified period. When querying for one day results are shown in minutes per every hour, otherwise in hours for each day.

api.reports.getGoalsReport(params, callback)

Shows the number of reached goals.

Status

api.status.get(parameters, callback)

Returns current LiveChat status.

Visitors

api.visitors.list(callback)

Returns list of the visitors available on pages with tracking code installed.

api.visitors.listOnlyChattingVisitors(callback)

Returns list of currently chatting visitors.

api.visitors.addCustomVisitorDetails(id, parameters, callback)

Displays additional information about the visitor in LiveChat apps. Detailed explaination available on API documentation page.