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

@todak2000/react-user-analytics

v1.0.6-b.0

Published

A package that provide quick functionality to detect user location, device, current navigation page, unique user visit

Downloads

1

Readme

REACT-USER-ANALYTICS

License: MIT

This package was built to manage recurrent functionalities during development of interfaces. The idea is to allow a developer collect these user data and use as appropriately say built a dashboard to manage the data and subesequently make informed decisions. E.g. these data can be collected and sent to the server for analytics purposes. So, a developer can quickly :

  • get a user Location (Country and City) by using the useGetUserLocation Hook.
  • get the type of Device (mobile/desktop) a user is using to access the application by using the useUserDevice Hook.
  • get a user current navigation page by using the useUserNavigation Hook.
  • check if a is a unique visitor or otherwise by using the useIsUserUnique Hook.

NB: useIsUserUnique is just client side and that clearing the localstorage invaidates someone as a unique user and that server implementation is recommended.

Quickstart

Install this library:

npm i @todak2000/react-user-analytics
# or
yarn add @todak2000/react-user-analytics

Then, import and use any of the functionalities you might require:

...
import {
  useGetUserLocation,
  useUserDevice,
  useIsUserUnique,
  useUserNavigation,
} from '@todak2000/react-user-analytics';

function SampleApp() {

  const {country, city} = useGetUserLocation();
  const uniqueUser:boolean = useIsUserUnique();
  const nav: string = useUserNavigation();
  const device: string = useUserDevice();


  return (
    <div >

      <header >
        <p>You are currently in {city}, {country}</p>
        {JSON.stringify(uniqueUser) === "true" ?
          <p>You are new User</p>
          :
          <p>You are a regular user</p>
        }
        <p>You are currently on this page: {nav}</p>
        <p>Your Device is: {device}</p>
      </header>


    </div>
  );
}



export default SampleApp;

Author

Daniel Olagunju