@heimdallr-sdk/fetch
English
捕获 fetch 请求,上报请求头、响应、请求耗时
Options
|配置名称|类型|是否必填|描述|默认值|
|-|-|-|-|
|ignoreUrls|Array|否|过滤请求url|-|
|reportResponds|Boolean|否|是否上报接口返回值|false|
Usage
cdn
<script src="[fetch-dist]/fetch.iife.js"></script>
<script>
window.__HEIMDALLR_OPTIONS__ = {
dsn: {
host: 'localhost:8888',
init: '/project/init',
upload: '/log/upload'
},
app: {
name: 'playgroundAPP',
leader: 'test',
desc: 'test proj'
},
plugins: [
HEIMDALLR_FETCH(),
]
};
</script>
<script async src="/browser-dist/browser.iife.js"></script>
npm
import heimdallr from "@heimdallr-sdk/browser";
import fetchPlugin from "@heimdallr-sdk/fetch";
heimdallr({
dsn: {
host: 'localhost:8888',
init: '/project/init',
upload: '/log/upload'
},
app: {
name: 'playgroundAPP',
leader: 'test',
desc: 'test proj'
},
plugins: [
fetchPlugin(),
]
});