Socket
Socket
Sign inDemoInstall

@heimdallr-sdk/customer

Package Overview
Dependencies
2
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @heimdallr-sdk/customer

A plugin For Browser SDK


Version published
Weekly downloads
16
increased by60%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@heimdallr-sdk/customer

English

捕获用户信息、业务信息

自动捕获本地存储的用户信息并上报

在 window 上挂载了 HEIMDALLR_REPORT 方法,用于上报业务信息

HEIMDALLR_REPORT

/**
 * @params {string} customerType - 自定义类型
 * @params {any} data - 上报数据
*/
window.HEIMDALLR_REPORT(customerType, data);

Auto Report

Options

配置名称类型描述
customerArray客户端上报数据(页面加载完成时收集)

customer

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

Usage

cdn

<script src="[customer-dist]/customer.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_CUSTOMER({
                customers: [{
                    name:'state.userid',
                    postion:'local'
                }]
            }),
        ],
    };
</script>
<script async src="/browser-dist/browser.iife.js"></script>

npm

import heimdallr from "@heimdallr-sdk/browser";
import customerPlugin from "@heimdallr-sdk/customer";
heimdallr({
    dsn: {
        host: 'localhost:8888',
        init: '/project/init',
        upload: '/log/upload'
    },
    app: {
        name: 'playgroundAPP',
        leader: 'test',
        desc: 'test proj'
    },
    plugins: [
        customerPlugin({
            customers: [{
                name:'userid',
                postion:'local'
            }]
        }),
    ],
});

Keywords

FAQs

Last updated on 29 Jun 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc