@huolala-tech/page-spy-uniapp
TypeScript icon, indicating that this package has built-in type declarations

1.9.10 • Public • Published

English | 中文

@huolala-tech/page-spy-uniapp

SDK version SDK size

The SDK used in UniAPP miniprogram environment.

[!CAUTION] When submitting the mini program for review, be sure to delete the SDK in the code, otherwise the review will fail.

Usage

import PageSpy from '@huolala-tech/page-spy-uniapp'

const pageSpy = new PageSpy(config?: InitConfig)

InitConfig definition

Except for the api parameter is required, all others parameters are optional:

interface InitConfig {
  // Server domain, must be provided。
  // Example:"example.com"
  api: string;

  // "project" is an aggregation of information that can be searched in the room list on the debug side.
  // default: 'default'
  project?: string;

  // "title" is a user-defined parameter that can be used to distinguish the current debugging client,
  // and the corresponding information is displayed under the "device id" in each debugging connection panel.
  // default: '--'
  title?: string;

  // Manually specify the scheme of the PageSpy service.
  // Note that except for development environment, mini-program requires the scheme to be set to "https", so:
  //  - By default, pass the value undefined or null, the SDK will parse it to TRUE;
  //  - true: the SDK will access the PageSpy service via ["https://", "wss://"];
  //  - false: the SDK will access the PageSpy service via ["http://", "wss://"].
  enableSSL?: boolean | null;

  // Disable pagespy on release environment.
  // - true (Default): only allow pagespy init on develop and trail environment.
  // - false: allow using in release environment
  disabledOnProd?: boolean | null;

  // All internal plugins are carried with PageSpy by default out of the box.
  // You can disable some plugins as needed.
  disabledPlugins?: (InternalPlugins | string)[];

  // For some mp types like mPaaS, DingTalk and some old version of Alipay, only one socket connection is allowed. But for some reason we cannot detect this feature by code, so we provide this option for you.
  // If you are developing mPaaS, DingTalk or some other ali-family mp which encounter a connection problem, you can set this option to true.
  singletonSocket?: boolean;
}

type InternalPlugins =
  | 'ConsolePlugin'
  | 'ErrorPlugin'
  | 'NetworkPlugin'
  | 'StoragePlugin'
  | 'SystemPlugin';

For more details of mini-program usage, please refer to Mini-Program Usage

Package Sidebar

Install

npm i @huolala-tech/page-spy-uniapp

Weekly Downloads

41

Version

1.9.10

License

MIT

Unpacked Size

305 kB

Total Files

8

Last publish

Collaborators

  • qikang.yuan
  • huolala-fe
  • zhiyang-deng
  • wangdashuai
  • blucass
  • yanagieiichi