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

apxor

v3.0.1

Published

Apxor Web Analytics

Downloads

1,602

Readme

Apxor Web SDK

Install through NPM

npm install --save apxor

SDK Initialization

Import Apxor sdk and initialize it in application root component or page

import Apxor from "apxor"; // ES6
//var Apxor = require('apxor'); // ES5

Apxor.init("YOUR_SITE_ID", {
  // Configuration options
});

Configuration Options

  • honorDNT: boolean [false],
  • idle_time_out: number(seconds) [1800]
  • plugins: []
  • deps: []
  • version: string [ALL]

Note:

Contact [email protected] to get your unique SITE_ID

Initialize Plugins

  • Run the following command in your terminal
npm install --save apxor-qe apxor-rtm
  • Add the following import statements in your root component or page. Make sure you add lint ignore lines for both of these lines, if you use lint
import CE from "apxor-qe";
import ApxorRTM from "apxor-rtm";
  • Add the following value in Configuration option's plugin and deps array
Apxor.init("YOUR_SITE_ID", {
  // ...
  plugins: ["ApxorRTM"],
  deps: [ApxorRTM, CE],
  // ...
});

APIs

UserId

A unique user identifier that you can assign to the user

Usage:

Apxor.setUserId(String);

Example:

Apxor.setUserId("[email protected]");

PageView

You can log a page view event when users navigate through your website

Usage:

Apxor.logPageView(String); //String URL pathname

Example:

Apxor.logPageView("/about.html");

App Events

Usage:

Apxor.logEvent(eventName, eventProperties);

Example:

Apxor.logEvent("ADD_TO_CART", {
  userId: "[email protected]",
  value: 1299,
  item: "Sony Head Phone 1201",
});

User Properties

Usage:

Apxor.setUserProperties({
  userProperty1: "value1",
  userProperty2: "value2",
});

Example:

Apxor.setUserProperties({
  gender: "Male",
  age: 24,
  isPaidUser: true,
  creditsLeft: 250,
});

Session Properties

Usage:

Apxor.setSessionProperties({
  property1: "value1",
  property2: "value2",
});

Example:

Apxor.setSessionProperties({
  language: "en",
  location: "Hyderabad",
});

Get Client Id

Use this API to get the unique identifier that Apxor SDK generates for this user

Example:

const clientId = Apxor.getClientId();

Start New Session

Starts new session if there is no active session. If a session is already in progress, it acts as a no-op

Apxor.startNewSession();

End Session

Ends the active session if any active session in progress. After this call, none of the Apxor APIs work, except startNewSession() API.

Apxor.endSession();

Handle Deeplink Redirection

For single page applications built with React/Angular/Vue, you need to handle the internal redirection on your own by using the setRedirectionHandler method.

Example

Apxor.setRedirectionHandler((url) => {
  // Interpret the URL and redirect user to the specific URL
});