1.5.7 • Published 4 months ago

@huolala-tech/page-spy v1.5.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Coverage Status NPM Package Minified size

English | 中文

What's this

This repo is the SDK which be used in HuolalaTech/page-spy-web, where SDK collects information and page-spy-web consumes and filters, organizes, and converts information into a standardized format, which is then showed on the page.

Usage

For data security and your convenience, we provide a complete and out-of-box solution. Read the "How to use" section in the HuolalaTech/page-spy-web to get more detail.

After the integration, open your project in browser, there should be a widget (round container with white background and include logo) on the bottom left. If not, check your config.

The init parameters

Web

For browser, all parameters are optional, here is a description of each property and its default value:

window.$pageSpy = new PageSpy(config?: InitConfig)

interface InitConfig {
  // The SDK automatically analyses and determines the address of
  // the Server (api) and the address of the debug side (clientOrigin)
  // from the "src" value, assuming you introduced it from https://example.com/page-spy/index.min.js,
  // so the SDK will set it up internally:
  //   - api: "example.com"
  //   - clientOrigin: "https://example.com"
  // If your service is deployed elsewhere, you can manually specify here to override.
  api?: string;
  clientOrigin?: 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;

  // Indicates whether the SDK will automatically render the "Circle with Logo on White Background"
  // control in the bottom left corner of the client when initiation is complete. If set to false,
  // you can call window.$pageSpy.render() to render it manually.
  // default: true
  autoRender?: boolean;

  // Manually specify the scheme of the PageSpy service.
  // This works if the SDK can't correctly analyse the scheme, e.g. if PageSpy's browser plugin
  // is introduced into the SDK via chrome-extension://xxx/sdk/index.min.js, which will be
  // be parsed by the SDK as an invalid "chrome-extension://" and fallback to ["http://", "ws://"].
  //   - (Default) Pass the value undefined or null: the SDK will parse it automatically;
  //   - Pass boolean value:
  //     - 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;
}

Mini Program

Except for the api parameter, all parameters are optional, here is a description of each property and its default value:

const pageSpy = new PageSpy(config?: InitConfig)

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;
}

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

1.5.7

4 months ago

1.5.5

4 months ago

1.5.4

4 months ago

1.5.3

4 months ago

1.5.2

4 months ago

1.5.1

4 months ago

1.5.0

4 months ago

1.5.6

4 months ago

1.4.11

4 months ago

1.5.0-beta.8

4 months ago

1.5.0-beta.7

4 months ago

1.5.0-beta.6

4 months ago

1.5.0-beta.4

5 months ago

1.5.0-beta.5

4 months ago

1.4.10

5 months ago

1.5.0-beta.2

5 months ago

1.5.0-beta.1

5 months ago

1.5.0-beta.3

5 months ago

1.5.0-beta.0

5 months ago

1.4.9

5 months ago

1.4.8

5 months ago

1.4.7

5 months ago

1.4.6

5 months ago

1.4.5

5 months ago

1.4.4

5 months ago

1.4.3

5 months ago

1.2.5

9 months ago

1.4.2

6 months ago

1.2.4

10 months ago

1.4.1

6 months ago

1.3.2

7 months ago

1.2.3

10 months ago

1.4.0

6 months ago

1.3.1

7 months ago

1.2.2

10 months ago

1.3.0

9 months ago

1.2.1

11 months ago

1.2.0

11 months ago

1.1.0

12 months ago

1.1.0-beta.1

12 months ago

1.1.0-beta.0

12 months ago

1.0.5

12 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago