@forzoom/bh-integrations
最好搭配@forzoom/bh-webpack-plugin一起使用
Last updated 10 days ago by forzoom .
MIT · Original npm · Tarball · package.json
$ cnpm install @forzoom/bh-integrations 
SYNC missed versions from official npm registry.

Intro

最好搭配@forzoom/bh-webpack-plugin一起使用

发送数据时会尝试使用navigator.sendBeacon,发送的数据格式使用FormData,目前来看FormData的兼容性良好

Usage

和Vue进行集成

import Vue from 'vue';
import { BH, Integration, VueIntegration, VueIntegrationOptions } from '@forzoom/bh-integrations';

if (process.env.NODE_ENV === 'production') {
    const options: VueIntegrationOptions = {
        id: 'xxx',
        host: 'https://example.com',
        version: process.env.BH_RELEASE!, // process.env.BH_RELEASE将由 @forzoom/bh-webpack-plugin提供 
        Vue,
    };
    const vueIntegration = new Integration.Vue(options);
    vueIntegration.setup();
    BH.addIntegration(vueIntegration);
}
// @/store/user.ts
import { BH } from '@forzoom/bh-integrations';

// 上报用户id
BH.setUserId(basicInfo.id);

Todo

  1. [x] 添加beforeSend用于过滤不需要的错误
  2. [ ] 是否将report逻辑移动到BH,integration只保留setup

Current Tags

  • 0.1.3                                ...           latest (10 days ago)

12 Versions

  • 0.1.3                                ...           10 days ago
  • 0.1.2                                ...           11 days ago
  • 0.1.1                                ...           14 days ago
  • 0.1.0                                ...           17 days ago
  • 0.0.8                                ...           a month ago
  • 0.0.7                                ...           a month ago
  • 0.0.6 [deprecated]           ...           a month ago
  • 0.0.5                                ...           4 months ago
  • 0.0.4                                ...           4 months ago
  • 0.0.3                                ...           5 months ago
  • 0.0.2 [deprecated]           ...           5 months ago
  • 0.0.1 [deprecated]           ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 22
Last Day 0
Last Week 10
Last Month 61
Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |