Socket
Socket
Sign inDemoInstall

@intlsdk/report

Package Overview
Dependencies
5
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @intlsdk/report

```ts import Report, { Channel } from '@intlsdk/report';


Version published
Weekly downloads
1
Maintainers
1
Install size
1.44 MB
Created
Weekly downloads
 

Readme

Source

SDK 数据上报

Getting Started

import Report, { Channel } from '@intlsdk/report';

// 初始化(生成新session_id)
Report.init({
  env: 'sg', // 环境或后台域名,详见【env参数】
  gameId: 11, // INTL 分配的游戏 ID
  sigKey: 'xxx', // INTL一站式工作台分配的 SDK_KEY(与gameId匹配)
  channelId: Channel.Guest, // 登录渠道 ID
  appVersion: '1.2.3', // 业务应用版本号
  openId: 'clzhu', // 用户ID
});

// 扩展选项(不生成新session_id)
Report.extend({ openId: 'clzhu' });

// 上报kv数据(兼容数组方式批量上报,详见下方示例)
Report.reportEvents({
  eventName: 'xxx', // 自定义事件名称
  // 以下为其他自定义字段,详见tlog文档
});

// 批量上报kv数据
Report.reportEvents([
  {
    eventName: 'xxx', // 自定义事件名称
    // 以下为其他自定义字段,详见tlog文档
  },
  {
    srcId: 1000, // 数据源ID,默认为200表示自定义事件上报
    eventName: 'http', // 事件名称
    // 以下为其他自定义字段,详见tlog文档
  },
]);

env 参数

env参数兼容 2 种写法:区域标识简写完整url前缀,满足https://{env}-dr.intlgame.com格式的域名都可以使用区域标识简写方式

区域标识简写

  • sg 新加坡,与https://sg-dr.intlgame.com(完整 url 前缀)等效,下同
  • na 北美(azure)
  • mos 俄罗斯
  • jp 日本
  • eu 欧洲
  • aws-na 北美
  • sa 南美
  • lonelyfish lonelyfish 现网独立集群
  • us 硅谷(腾讯云)
  • in 印度

完整 url 前缀

任意 url 域名前缀,必须含https://,示例:https://sg-dr.intlgame.com,与sg(区域标识简写)等效

FAQs

Last updated on 30 Mar 2022

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