# ideamake-buried-point-test

> 这是一个关于埋点的sdk

Latest version **1.2.0** (published 2021-06-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install ideamake-buried-point-test
pnpm add ideamake-buried-point-test
yarn add ideamake-buried-point-test
bun add ideamake-buried-point-test
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2021-06-10 |
| First published | 2020-08-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 822.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jts |
| Maintainers | jiatesun0824 |
| Keywords | 123456 |

## Links

- npm: https://www.npmjs.com/package/ideamake-buried-point-test
- npm.io page: https://npm.io/package/ideamake-buried-point-test

## Dependencies (1)

- [crypto-js](https://npm.io/package/crypto-js.md) ^4.0.0

## Recent versions

- 1.2.0 (latest) — 2021-06-10
- 1.1.0 — 2021-06-10
- 1.0.36 — 2020-12-17
- 1.0.35 — 2020-12-17
- 1.0.34 — 2020-12-16
- 1.0.33 — 2020-11-24
- 1.0.32 — 2020-11-10
- 1.0.31 — 2020-10-29
- 1.0.30 — 2020-10-28
- 1.0.29 — 2020-10-28
- 1.0.28 — 2020-10-28
- 1.0.27 — 2020-10-16
- 1.0.26 — 2020-10-16
- 1.0.25 — 2020-09-24
- 1.0.24 — 2020-09-14
- … 10 more at https://npm.io/package/ideamake-buried-point-test/versions

## README

# 埋点SDK 使用说明

## 版本 v1.0.0

### 安装sdk

1. 安装

``` node
  yarn add ideamake-buried-point
```

### 使用sdk

1. 引入

``` javascript
  import { IdeamakeBuriedPoint } from 'ideamake-buried-point'
```

### 初始化

1. 初始化

``` javascript
  /**
  * @description 初始化埋点
  * @param {String} websocketUrl websocket地址【可选】
  * @param {String} userId 用户的id【必传】
  */
const ideamakeBuriedPoint = new IdeamakeBuriedPoint({websocketUrl: 'wss://...', userId: '12345678910'})
```

### 注册

1. uniapp打包生成的app

``` javascript
  /**
  * @description 注册uniapp生成的app
  * @param {Function} success 注册成功【可选】
  * @param {Function} fail 注册成功【可选】
  * @param {Object} data 基础参数【必传】
  * @param {String ｜ number} android_id 安卓id【可选】
  * @param {String} app_version 安卓版本号【可选】
  * @param {String} packgename app包名【可选】
  */
  ideamakeBuriedPoint.initUniApp({
    success() {}
    fail() {}
    data: { android_id, app_version, packgename }
  })
```

2. uniapp生成的小程序

``` javascript
  /**
  * @description 注册uniapp生成的小程序
  * @param {Function} success 注册成功【可选】
  * @param {Function} fail 注册成功【可选】
  * @param {Object} data 基础参数【必传】
  * @param {String} language 语言,zh-cn、zh、en-us、其他【可选】
  */
  ideamakeBuriedPoint.initUniMiniprogram({
    data: { language  }, success() {}, fail() {}
  })
```

3. uniapp生成的web

``` javascript
  /**
  * @description 注册uniapp生成的web
  * @param {Function} success 注册成功【可选】
  * @param {Function} fail 注册成功【可选】
  * @param {Object} data 基础参数【必传】
  * @param {String} language 语言,zh-cn、zh、en-us、其他【可选】
  */
  ideamakeBuriedPoint.initWeb({
    data: { language  }, success() {}, fail() {}
  })
```

4. 原生小程序

``` javascript
  /**
  * @description 注册原生小程序
  * @param {Function} success 注册成功【可选】
  * @param {Function} fail 注册成功【可选】
  * @param {Object} data 基础参数【必传】
  * @param {String} language 语言,zh-cn、zh、en-us、其他【可选】
  */
  ideamakeBuriedPoint.initNativeMiniprogram({
    data: { language  }, success() {}, fail() {}
  })
```

5. react/vue等开发的web

``` javascript
  /**
  * @description 注册uniapp生成的web
  * @param {Function} success 注册成功【可选】
  * @param {Function} fail 注册成功【可选】
  * @param {Object} data 基础参数【必传】
  * @param {String} language 语言,zh-cn、zh、en-us、其他【可选】
  */
  ideamakeBuriedPoint.initWeb({
    data: { language  }, success() {}, fail() {}
  })
```

### 使用

1. buriedPoint

``` javascript
  /**
  * @description 注册uniapp生成的web
  * @param {Object} data 基础参数【必传】
  * @param {Object} business 业务参数【必传】
  * @param {Object} id 事件id【必传】
  * @param {Object} event 事件参数【必传】
  * @param {String} type 事件类型： clickEvent：点击 pageEvent：曝光 routerEvent：跳转
  */
  ideamakeBuriedPoint.buriedPoint({
    data: {event = {}, business = {}, id = ''}, type
  })
```

---
_Source: https://npm.io/package/ideamake-buried-point-test · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
