{"id":13834442,"url":"https://github.com/acte-technology/thingsboard-js-sdk","last_synced_at":"2025-07-10T04:32:05.937Z","repository":{"id":50352877,"uuid":"337941564","full_name":"acte-technology/thingsboard-js-sdk","owner":"acte-technology","description":"Integrate Thingsboard backend to Javascript front-end frameworks and NodeJS","archived":false,"fork":false,"pushed_at":"2022-05-01T12:01:47.000Z","size":37,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-14T06:36:04.848Z","etag":null,"topics":["iot","nodejs","reactjs","thingsboard"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acte-technology.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-11T05:48:31.000Z","updated_at":"2024-09-19T01:16:09.000Z","dependencies_parsed_at":"2022-08-30T01:30:58.715Z","dependency_job_id":null,"html_url":"https://github.com/acte-technology/thingsboard-js-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acte-technology%2Fthingsboard-js-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acte-technology%2Fthingsboard-js-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acte-technology%2Fthingsboard-js-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acte-technology%2Fthingsboard-js-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acte-technology","download_url":"https://codeload.github.com/acte-technology/thingsboard-js-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225618847,"owners_count":17497590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["iot","nodejs","reactjs","thingsboard"],"created_at":"2024-08-04T14:00:34.669Z","updated_at":"2024-11-20T19:32:01.510Z","avatar_url":"https://github.com/acte-technology.png","language":"JavaScript","readme":"# Thingsboard Javascript SDK\n\nThingsboard Javascript SDK\n\n**Dev version, work in progress.**\n\n## Installation\n\n```bash\nnpm install thingsboard-js-sdk\n```\n\n## Examples\n\n* Reactjs, checkout docs/reactjs.js component.\n\n\n## Methods\n\n- connect\n- disconnect\n- subscribe (websocket)\n- getTenantDevices\n- getKeys (timeseries \u0026 attributes)\n- deleteEntityKeys (timeseries \u0026 attributes)\n- getAttributesByScope\n- getTimeseries\n\n### Import client class\n\n```js\nimport tbClient from 'thingsboard-js-sdk';\nconst client = new tbClient(config);\n```\n\n### Connect to public device\n\n```js\nconst client = new tbClient({\n  host: 'localhost',\n  publicId: 'xxx-xxx-xxx-xxx' // dashboard public id\n});\n\nconst connect = async () =\u003e {\n\n  const token = await client.connect(true); //true for public login\n\n}\n```\n\n### Connect with user/password\n\n```js\nconst client = new tbClient({\n  host: 'localhost',\n  username: 'username',\n  password: 'password'\n});\n\nconst connect = async () =\u003e {\n\n  const token = await client.connect();\n\n}\n```\n\n### Get Tenant Devices\n\n*must be logged as a tenant*\n\n```js\nconst params = {\n  pageSize: 100,\n  page: 0,\n  sortProperty: 'name',\n  sortOrder: 'ASC'\n}\n//...\nlet devices = await client.getTenantDevices(params, callback)\n```\n\n### Get Keys\n\n```js\nconst params = {\n  entityId: 'xxx-xxx-xxx',\n  scope: 'timeseries', //timeseries | client | shared | server\n}\n//...\nlet keys = await client.getKeys(params, callback)\n```\n\n### Get Attributes By Scope\n\n```js\nconst params = {\n  entityId: 'xxx-xxx-xxx',\n  scope: 'CLIENT_SCOPE', // CLIENT_SCOPE | SHARED_SCOPE | SERVER_SCOPE\n  keys: ['temperature', 'humidity']\n}\n//...\nlet attrs = await client.getAttributesByScope(params, callback)\n```\n\n### Delete keys\n\n```js\nconst params = {\n  entityId: 'xxx-xxx-xxx',\n  keys: ['temperature', 'humidity'],\n  olderThan: Date.now()-3600, //delete older than 1 hour\n  scope: 'timeseries' // timeseries, client, shared, server\n}\n//...\nlet response = await client.deleteEntityKeys(params, callback)\n```\n\n### Get timeseries\n\n```js\nconst now = Date.now();\n\nconst params = {\n  entityId: 'xxx-xxx-xxx',\n  keys: ['temperature', 'humidity']\n  limit: 500,\n  agg: 'AVG',\n  interval: 60000,\n  startTs: now-3600000,\n  endTs: now,\n  useStrictDataTypes: true\n}\n//...\nlet timeseries = await client.getTimeseries(params, callback)\n```\n\n### WSS Websocket subscribe\n\n```js\nconst params = {\n  entityId: 'xxx-xxx-xxx',\n  cmdId: 10 //websocket id\n}\n//...\nlet keys = await client.subscribe(params, callback)\n```\n\n## Issues\n\nGithub: https://github.com/acte-technology/thingsboard-js-sdk/issues\n\n## Working examples:\n\n- Public data integration: https://acte.ltd/iot/dashboards/aqi\n- Tenant access: https://acte.ltd/iot/client/login\n","funding_links":[],"categories":["SDKs and REST clients"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facte-technology%2Fthingsboard-js-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facte-technology%2Fthingsboard-js-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facte-technology%2Fthingsboard-js-sdk/lists"}