Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@heimdallr-sdk/browser

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@heimdallr-sdk/browser

A SDK For Monitoring Browser

  • 0.0.33
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-73.33%
Maintainers
0
Weekly downloads
 
Created
Source

@heimdallr-sdk/browser

English

浏览器监控基座,内置错误捕获sdk

可捕获错误类型

  • js错误
  • 资源加载错误
  • unhandledrejection

默认使用 sendBeaconAPI (post)上报

配置项

配置名称类型描述可选值默认值
dsnObject上报接口配置信息DSN-
appObject应用信息APPInfo-
enabledBoolean是否向后台发送事件true/falsetrue
maxBreadcrumbsNumber面包屑最大层级-5
stkLimitNumber收集错误栈层级-3
userIdentifyCustomer用户标识--
pluginsArray插件集合--
debugBoolean控制台是否显示sdk输出信息true/falsefalse

DSN

名称类型描述可选值
hostString上报接口域名地址-
initString应用初始化接口地址-
reportString信息上报接口地址-

APPInfo

名称类型描述可选值
nameString应用名称-
leaderString负责人-
descString应用描述-

Customer

名称类型描述可选值
namestring业务字段名称(支持点运算符读取,cookie除外)-
positionstring存储位置local/session/cookie/global

使用方式

cdn

<script>
    window.__HEIMDALLR_OPTIONS__ = {
        dsn: {
            host: 'localhost:8888',
            init: '/project/init',
            report: '/log/report'
        },
        app: {
            name: 'playgroundAPP',
            leader: 'test',
            desc: 'test proj'
        },
        userIdentify: {
            name: '__state__.a.0.user.id', // window.__state__ = { a: [{ user: { id:'123' } }] }
            position: 'global'
        }
    };
</script>
<script async src="/browser-dist/browser.iife.js"></script>

npm

import heimdallr from "@heimdallr-sdk/browser";
heimdallr({
    dsn: {
        host: 'localhost:8888',
        init: '/project/init',
        report: '/log/report'
    },
    app: {
        name: 'playgroundAPP',
        leader: 'test',
        desc: 'test proj'
    },
    userIdentify: {
        name: '__state__.a.0.user.id', // window.__state__ = { a: [{ user: { id:'123' } }] }
        position: 'global'
    }
});

上报数据

应用初始化

字段名称描述
id应用id
name应用名称
leader负责人
desc应用描述

日志上报

字段名称描述特有
aid应用id-
sid会话id-
uid独立用户id-
p平台-
ttl页面标题页面加载
url页面路径-
lan语言页面加载
uaUser-agent页面加载
ws窗口分辨率页面加载
ds文档分辨率页面加载
lid日志id-
t时间戳-
e日志类型-
b面包屑页面卸载
dat日志详情(插件不同有差异,都带有日志子类型)-
平台类型
描述
1浏览器
2微信小程序
3Node
日志类型
描述
1生命周期
2异常
3性能
4请求
5节点操作
6路由
7控制台输出
8录屏
9Vue
10自定义
日志子类型

以下为提供的内置类型,可自由扩展

描述
11页面加载
12页面卸载
21js 异常
22资源加载异常
23未捕获 reject 异常
24页面崩溃
31FMP
32FPS
33性能基础参数
34VITALS
35资源加载情况
41XMLHttpRequest 请求
42fetch 请求
51页面点击
61hash路由跳转
62history路由跳转
111自定义类型

Keywords

FAQs

Package last updated on 15 Oct 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc