{"id":19411569,"url":"https://github.com/volcengine/tls-js-sdk","last_synced_at":"2026-05-12T20:32:37.556Z","repository":{"id":97907327,"uuid":"536930144","full_name":"volcengine/tls-js-sdk","owner":"volcengine","description":"tls js sdk for browser","archived":false,"fork":false,"pushed_at":"2022-10-25T08:22:53.000Z","size":54,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-07T15:21:13.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/volcengine.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}},"created_at":"2022-09-15T08:20:43.000Z","updated_at":"2023-07-06T09:56:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc465431-e220-47d3-8413-f43ed4557463","html_url":"https://github.com/volcengine/tls-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/volcengine%2Ftls-js-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Ftls-js-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Ftls-js-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Ftls-js-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/volcengine","download_url":"https://codeload.github.com/volcengine/tls-js-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240589030,"owners_count":19825285,"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":[],"created_at":"2024-11-10T12:22:04.255Z","updated_at":"2026-05-12T20:32:32.530Z","avatar_url":"https://github.com/volcengine.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TLS JS SDK \n[中文文档](https://github.com/volcengine/tls-js-sdk/blob/master/README.zh_CN.md)\n\nThis is TLS JS SDK for browser.\n\u003e TLS is short for Tinder Log Service.\n\n# Installation\n\n```shell\nnpm install -S @volcengine/tls-js-sdk\n```\n\n# Basic Usage\n\nImport in the module file\n```typescript\nimport { WebTrackerBrowser } from '@volcengine/tls-js-sdk';\n\nconst wtb = new WebTrackerBrowser({\n  host: 'your host',\n  projectId: 'your projectId',\n  topicId: 'your topicId',\n});\n\n```\n\nImport directly in the browser\n```html\n\u003chtml\u003e\n\u003chead\u003e\u003c/head\u003e\n\u003cbody\u003e\n\u003cscript src=\"path/to/tls-js-sdk/dist/tls_browser.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    const wtb = new TLS_Browser.WebTrackerBrowser({\n        host: 'your host',\n        projectId: 'your projectId',\n        topicId: 'your topicId',\n    });\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n# API\n## WebTrackerBrowser\nClass for web tracker in browser\n\n```typescript\nimport { WebTrackerBrowser } from '@volcengine/tls-js-sdk';\n\nconst wtb = new WebTrackerBrowser({\n  host: 'your host', // required\n  projectId: 'your projectId', // required\n  topicId: 'yourt topicId', // required\n  protocol: 'your protocol', // optional.The default value is https\n  time: 'batch log time interval', // optional.The default value is 10s.\n  count: 'batch log limit', // optional.The default value is 10.\n  source: 'log source', // optional.\n});\n```\n\nWebTrackerBrowser instance method below.\n\n### send\n\nsend(data)\n\n| params  | description                                                                    |\n|:--------|:-------------------------------------------------------------------------------|\n| data    | (required) like { [index: string]: any } |\n\n```typescript\nwtb.send({\n  key: 'value', // custom key/value\n});\n```\n\n### sendImmediate\n\nsendImmediate(data)\n\n| params  | description                                                                    |\n|:--------|:-------------------------------------------------------------------------------|\n| data    | (required) like { [index: string]: any } |\n\n```typescript\nwtb.sendImmediate({\n  key: 'value', // custom key/value\n});\n```\n\n### sendBatchLogs\nsendBatchLogs(data)\n\n| params  | description                                                                                                                                                       |\n|:--------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| data    | (required)  like Array\u003cRecord\u003cstring, any\u003e\u003e                                                                                                                                          |\n\n```typescript\nwtb.sendBatchLogs([{ key: 'value' }]);\n```\n\n### sendBatchLogsImmediate\n\nsendBatchLogsImmediate(data)\n\n| params  | description                                          |\n|:--------|:-----------------------------------------------------|\n| data    | (required) like Array\u003c Record\u003cstring, any\u003e[]\u003e                              |\n\n```typescript\nwtb.sendBatchLogsImmediate([{ key: 'value' }])\n```\n## Security\n\nIf you discover a potential security issue in this project, or think you may\nhave discovered a security issue, we ask that you notify Bytedance Security via our [security center](https://security.bytedance.com/src) or [vulnerability reporting email](sec@bytedance.com).\n\nPlease do **not** create a public GitHub issue.\n\n# License\nThis project is licensed under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolcengine%2Ftls-js-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolcengine%2Ftls-js-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolcengine%2Ftls-js-sdk/lists"}