@volcengine/tls-js-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

TLS JS SDK

中文文档

This is TLS JS SDK for browser.

TLS is short for Tinder Log Service.

Installation

npm install -S @volcengine/tls-js-sdk

Basic Usage

Import in the module file

import { WebTrackerBrowser } from '@volcengine/tls-js-sdk';

const wtb = new WebTrackerBrowser({
  host: 'your host',
  projectId: 'your projectId',
  topicId: 'your topicId',
});

Import directly in the browser

<html>
<head></head>
<body>
<script src="path/to/tls-js-sdk/dist/tls_browser.js"></script>
<script>
    const wtb = new TLS_Browser.WebTrackerBrowser({
        host: 'your host',
        projectId: 'your projectId',
        topicId: 'your topicId',
    });
</script>
</body>
</html>

API

WebTrackerBrowser

Class for web tracker in browser

import { WebTrackerBrowser } from '@volcengine/tls-js-sdk';

const wtb = new WebTrackerBrowser({
  host: 'your host', // required
  projectId: 'your projectId', // required
  topicId: 'yourt topicId', // required
  protocol: 'your protocol', // optional.The default value is https
  time: 'batch log time interval', // optional.The default value is 10s.
  count: 'batch log limit', // optional.The default value is 10.
  source: 'log source', // optional.
});

WebTrackerBrowser instance method below.

send

send(data)

params description
data (required) like { [index: string]: any }
wtb.send({
  key: 'value', // custom key/value
});

sendImmediate

sendImmediate(data)

params description
data (required) like { [index: string]: any }
wtb.sendImmediate({
  key: 'value', // custom key/value
});

sendBatchLogs

sendBatchLogs(data)

params description
data (required) like Array<Record<string, any>>
wtb.sendBatchLogs([{ key: 'value' }]);

sendBatchLogsImmediate

sendBatchLogsImmediate(data)

params description
data (required) like Array< Record<string, any>[]>
wtb.sendBatchLogsImmediate([{ key: 'value' }])

Security

If you discover a potential security issue in this project, or think you may have discovered a security issue, we ask that you notify Bytedance Security via our security center or vulnerability reporting email.

Please do not create a public GitHub issue.

License

This project is licensed under the MIT License.

/@volcengine/tls-js-sdk/

    Package Sidebar

    Install

    npm i @volcengine/tls-js-sdk

    Weekly Downloads

    0

    Version

    0.0.3

    License

    none

    Unpacked Size

    624 kB

    Total Files

    16

    Last publish

    Collaborators

    • msq17
    • caocun
    • garyyangbyte
    • lvpiao
    • chenping.123
    • bytedance_liutaofe
    • ash.yu
    • zhenran.sz
    • vcloud_fe
    • zhuhongshuyu
    • wangyx.byte
    • shushushu
    • zhoulei
    • shanggw
    • liangshuang.fiona
    • zhengwenyue
    • wallaceyuan
    • cmaxd
    • liuzhao.90
    • liucheng.bigorange
    • zhouyk
    • oanakiaja
    • chenyongjin
    • lixiangfeiorg
    • awesome-starling
    • zhang6464
    • volcanoengine
    • bytednpm