{"id":36895688,"url":"https://github.com/livechat/lc-sdk-js","last_synced_at":"2026-01-12T15:41:56.618Z","repository":{"id":37753201,"uuid":"274119978","full_name":"livechat/lc-sdk-js","owner":"livechat","description":"LC Platform API SDK for JavaScript","archived":false,"fork":false,"pushed_at":"2025-11-27T13:47:28.000Z","size":2202,"stargazers_count":8,"open_issues_count":5,"forks_count":7,"subscribers_count":12,"default_branch":"v3.7","last_synced_at":"2025-11-30T04:58:27.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@livechat/lc-sdk-js","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/livechat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-06-22T11:34:43.000Z","updated_at":"2025-11-24T11:02:37.000Z","dependencies_parsed_at":"2023-12-12T13:28:54.259Z","dependency_job_id":"6aed9bac-b75d-4842-88dc-8b440616c423","html_url":"https://github.com/livechat/lc-sdk-js","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/livechat/lc-sdk-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Flc-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Flc-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Flc-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Flc-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livechat","download_url":"https://codeload.github.com/livechat/lc-sdk-js/tar.gz/refs/heads/v3.7","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Flc-sdk-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-12T15:41:55.865Z","updated_at":"2026-01-12T15:41:56.613Z","avatar_url":"https://github.com/livechat.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiveChat Platform API SDK for Javascript\n\nThis Software Development Kit written in Typescript helps developers build external backend apps that extend LiveChat features. The SDK makes it easy to use Agent Chat API, Customer Chat API and Configuration API.\n\n## API protocol docs\n\nFor protocol documentation of LiveChat APIs, please go to [Livechat Platform Docs](https://developers.livechatinc.com/docs/).\n\n## Technical docs\n\nFor technical documentation visit [docs](https://github.com/livechat/lc-sdk-js/blob/v3.7/docs/README.md)\n\n## SDK version vs API version\n\nHere is the relation between SDK versions and API versions:\n* lc-sdk-js 4.x.x -\u003e LiveChat API 3.4\n* lc-sdk-js 5.x.x -\u003e LiveChat API 3.5\n* lc-sdk-js 6.x.x -\u003e LiveChat API 3.6\n* lc-sdk-js 7.x.x -\u003e LiveChat API 3.7\n* ...\n\nAll versions of LiveChat JS SDK are available on [npm](https://www.npmjs.com/package/@livechat/lc-sdk-js).\nNote that developer-preview version is not completed yet - it may introduce breaking changes in the future.\n\n## Installation\n\n### npm\n\nTo install latest stable version use:\n\n```bash\nnpm install @livechat/lc-sdk-js\n```\n\n## Authorization\n\nAuthorization in SDK is based on [TokenGetter](https://github.com/livechat/lc-sdk-js/blob/v3.7/src/authorization/token_getter.ts)\nrequired in both Web and RTM API classes. Example token getter:\n\n```javascript\nconst tokenGetter = () =\u003e ({\n  accessToken: \"dal:ab-Cd_dE40f9G3H297Ijkl6MN24\",\n  organizationID: \"c31de08c-799b-488a-982a-8e64dbadbf5a\",\n  region: \"dal\",\n  tokenType: \"Bearer\",\n});\n```\n\n### Web API vs RTM API\n\nIn case of Web APIs, the example token getter corresponds to the following headers in requests:\n* `Authorization: Bearer dal:ab-Cd_dE40f9G3H297Ijkl6MN24`\n* `X-Region: dal`\n\nIn case of RTM APIs, the example token getter corresponds to:\n* query string used when opening the WebSocket connection: `?organization_id=c31de08c-799b-488a-982a-8e64dbadbf5a\u0026region=dal`\n* token used in login method: `Bearer dal:ab-Cd_dE40f9G3H297Ijkl6MN24`\n\n### Organization's region\n\nFor `Bearer` tokens, organization's region is the token prefix before the colon:\n* accessToken: `dal:ab-Cd_dE40f9G3H297Ijkl6MN24` -\u003e region: `dal`\n\nIf you need to find region\nfor [Personal Access Token (PAT)](https://platform.text.com/docs/authorization/agent-authorization#personal-access-tokens),\nuse [tokenGetterFromPAT](https://github.com/livechat/lc-sdk-js/blob/v3.7/src/authorization/personal_access_token.ts) helper.\n\n## Browser and Node.js compatibility\n\nDue to the absence of standard library WebSocket implementation in Node.js and presence of [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) class in browser environments,\nusing the RTM API requires the developer to pass an appropriate WebSocket implementation to the constructor of the RTM clients:\n\n```javascript\nimport { Agent, Customer } from \"@livechat/lc-sdk-js\";\n\nconst agentTokenGetter = () =\u003e ...\nconst customerTokenGetter = () =\u003e ...\n\nconst agentAPI = new Agent.RTM(WebSocket, agentTokenGetter);\nconst customerAPI = new Customer.RTM(WebSocket, customerTokenGetter);\n```\n\nSee the examples:\n\n* [browser](https://github.com/livechat/lc-sdk-js/blob/v3.7/examples/react-rtm-messages/src/ws.tsx) - here we use the [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)\n* [Node.js](https://github.com/livechat/lc-sdk-js/blob/v3.7/examples/node-rtm-messages/index.ts) - here we recommend the [ws](https://www.npmjs.com/package/ws) package\n\n## Feedback\n\nIf you find any bugs or have trouble implementing the code on your own, please create an issue or contact us [LiveChat for Developers](https://developers.livechatinc.com/).\n\n## About LiveChat\n\nLiveChat is an online customer service software with live support, help desk software, and web analytics capabilities. It's used by more than 30,000 companies all over the world. For more info, check out [LiveChat](https://livechat.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivechat%2Flc-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivechat%2Flc-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivechat%2Flc-sdk-js/lists"}