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

@kurorobeasts/mavis-app-tracking

v0.1.3

Published

This is a client for the Mavis tracking API. This library uses the same Event modeling as described in the [Mavis API documentation](https://docs.skymavis.com/mavis/app-tracking/guides/tracking-api#events). ## Getting Started

Downloads

30

Readme

Mavis App Tracking library

This is a client for the Mavis tracking API. This library uses the same Event modeling as described in the Mavis API documentation.

Getting Started

Initialise the MavisTracking instance

import MavisTracking from "@kurorobeasts/mavis-app-tracking";
// This will start a session and send events to the server every 10 seconds by default.
// As long as this instance is alive, it will keep sending queued events to the server unless explicitely stopped.
const tracking = new MavisTracking(API_KEY);

Now you're ready to start sending events to the server. But first you need to identify the user in order to get proper Events data.

Note: If no API_URL is provided, the library will use the default Mavis tracking API URL.

Identifying the user

tracking.identify("user_id", "ronin_address", { key: "value" });

This library will try to get the platform and device information automatically and send it in the identify event.

Sending events

tracking.track("event_name", { key: "value" });

Tracking screens

At the moment of writing this README, this library doesn't track screens automatically. You need to track screens manually.

tracking.screen("screen_name", { key: "value" });

Changing session

If you need to start a new session, you can reset the session and identify the user again.

tracking.resetSession();
tracking.identify("new_user_id", "new_user_ronin_address", { key: "value"});

Note: All previous session events will be sent to the server since they're already in the queue. New queued events will be linked to the new session.

Gracefully stopping the tracking

If you need to stop the tracking, you can call the shutdown method. This will stop the interval that sends events to the server; all queued events will be sent to the server. But remember, if you need to start tracking again, you need to create a new instance of MavisTracking.

await tracking.shutdown();

Session duration

Heartbeats are automatically sent to track the user session. You can disable heartbeats like this:

const tracking = new MavisTracking(API_KEY, { enableHeartbeat: false });

This library sends heartbeats every 30 seconds by default. If you want to change the frequency, you can send the desired frequency in milliseconds.

const tracking = new MavisTracking(API_KEY, { heartbeatInterval: 10_000 }); // 10 seconds

TODO: Add more examples

License

MIT