npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ssr-web-avo-inspector

v2.0.0-alpha.0

Published

Avo Inspector for web with SSR and web workers support

Downloads

49,490

Readme

SSR and Web Workers Avo Inspector

npm version

This is a special build for server side rendering and web workers. If you don't need those features use the main library

Avo documentation

This is a quick start guide. For more information about the Inspector project please read Avo documentation.

Installation

The library is distributed with npm

    npm i ssr-web-avo-inspector

or

    yarn add ssr-web-avo-inspector

Initialization

Obtain the API key at Avo.app

import * as Inspector from "ssr-web-avo-inspector";

let inspector = new Inspector.AvoInspector({
  apiKey: "your api key",
  env: Inspector.AvoInspectorEnv.Dev,
  version: "1.0.0",
  appName: "My app",
  suffix: "instance0"
});

Enabling logs

Logs are enabled by default in the dev mode and disabled in prod mode.

inspector.enableLogging(true);

Integrating with Avo Codegen (Avo generated code)

The setup is lightweight and is covered in this guide.

Every event sent with Avo Function after this integration will automatically be sent to the Avo Inspector.

Sending event schemas for events reported outside of Avo Codegen

Whenever you send tracking event call one of the following methods:

Read more in the Avo documentation

1.

This method gets actual tracking event parameters, extracts schema automatically and sends it to the Avo Inspector backend. It is the easiest way to use the library, just call this method at the same place you call your analytics tools' track methods with the same parameters.

inspector.trackSchemaFromEvent("Event name", {
  "String Prop": "Prop Value",
  "Float Prop": 1.0,
  "Boolean Prop": true,
});

2.

If you prefer to extract data schema manually you would use this method.

inspector.trackSchema("Event name", [
  { propertyName: "String prop", propertyType: "string" },
  { propertyName: "Float prop", propertyType: "float" },
  { propertyName: "Boolean prop", propertyType: "boolean" },
]);

Extracting event schema manually

let schema = inspector.extractSchema({
  "String Prop": "Prop Value",
  "Float Prop": 1.0,
  "Boolean Prop": true,
});

You can experiment with this method to see how more complex schemas look, for example with nested lists and objects.

Batching control

In order to ensure our SDK doesn't have a large impact on performance or battery life it supports event schemas batching.

Default batch size is 30 and default batch flush timeout is 30 seconds. In development mode batching is disabled.

inspector.setBatchSize(15);
inspector.setBatchFlushSeconds(10);

Developing

If you find anything could be improved or added to this package we welcome your contributions.

Getting started

To make changes you'll need to have a recent version of Node installed and Yarn (version 1) to install (and update, if need) the proper packages. Run yarn install to install the dependencies and yarn build to compile the TypeScript files.

Making changes

While you're developing you can use the watch mode to compile your files while you're editing: yarn build --watch. Once you've made your changes run yarn test to make sure the tests pass. If you've added new functionality please add tests for it as well. Once you're happy with your changes please open a PR.

Publishing

When you have unpublished changes on the main branch that you want to get out to the world you can publish a new version. Pull the latest version and run yarn build followed by npm publish. Note that this is only an option for members of the Avo team. Add a summary of the changes from the last version to the changelog, make a commit with the increased version number called Release x.y.z and tag it with the same version number (x.y.z).

Author

Avo (https://www.avo.app), [email protected]

License

AvoInspector is available under the MIT license.