🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

browser-log-reporter

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-log-reporter

### 引入方式

latest
npmnpm
Version
1.1.5
Version published
Maintainers
1
Created
Source

Browser Log Reporter

引入方式

js引入

  <script src="./alirtc-log-repoter.js"></script>
npm引入
  npm i browser-log-reporter

创建实例

  import {LogReporter} from "browser-log-reporter";

  let reporter = new LogReporter({
    wsUrl: 'wss://xxx.xx.xx',
    product: 1
  });

监听事件

  reporter.on("onReconnect", () => {
    // websocket重连消息
  })

  reporter.on("onError", (arr: []) => {
    // websocket重连失败,需要降级
  })

发送埋点

  reporter.send({xxx: ''});

关闭埋点上报

  reporter.close();

FAQs

Package last updated on 07 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts