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

@heimdallr-sdk/browser

Package Overview
Dependencies
Maintainers
1
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 Errors

  • 0.0.22
  • Source
  • npm
  • Socket score

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

@heimdallr-sdk/browser

English

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

可捕获错误类型

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

默认使用 sendBeaconAPI (post)上报

Options

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

DSN

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

APPInfo

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

Customer

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

Usage

cdn

<script>
    window.__HEIMDALLR_OPTIONS__ = {
        dsn: {
            host: 'localhost:8888',
            init: '/project/init',
            upload: '/log/upload'
        },
        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',
        upload: '/log/upload'
    },
    app: {
        name: 'playgroundAPP',
        leader: 'test',
        desc: 'test proj'
    },
    userIdentify: {
        name: '__state__.a.0.user.id', // window.__state__ = { a: [{ user: { id:'123' } }] }
        position: 'global'
    }
});

Keywords

FAQs

Package last updated on 14 Mar 2023

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