# reportDAEvent

> 上报数据埋点

### reportDAEvent

> 上报数据埋点

#### 请求参数

| 参数          | 类型                          | 必填 | 说明             |
| ------------- | ----------------------------- | ---- | ---------------- |
| `eventName`   | `string`                      | 是   | 事件名           |
| `eventParams` | `object`                      | 否   | 上报参数         |
| `eventType`   | `string`                      | 否   | 开始结束类型传递 |
| `success`     | `() => void`                  | 否   | 成功回调         |
| `fail`        | `(error: BridgeCode) => void` | 否   | 失败回调         |
| `complete`    | `() => void`                  | 否   | 完成回调         |

#### 返回值

```js
Promise<void>
```

#### 示例代码

```js
import { reportDAEvent } from '@kbapp/js-bridge'

reportDAEvent({
    eventName: 'page_view',
    eventParams: { page: 'home' },
    success() {
        console.log('上报数据成功')
    },
    fail(error) {
        console.log('上报数据失败', error)
    },
})
```

> 支持 Promise 风格调用
