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 🙏

© 2025 – Pkg Stats / Ryan Hefner

seetrue.client.react

v0.3.1

Published

A react client to easily connect to and use the SeeTrue authentication service.

Readme

About The Project

SeeTrue.Client.React is a library which enables a seamless connection between your React application and a SeeTrue.API instance. On the background SeeTrue.Client.React uses SeeTrue.Client inside a React context, and it provides access to the authetication state and an API client through a hook.

SeeTrue.Client.React provides the following functionality:

  • Access to the authentication state
  • Acces to the autheticated user
  • Automatic token refresh on the background
  • Acces to the API client SeeTrue.Client

Built With

Built with hard work, tears, sweat, dedication and love.

Getting Started

Prerequisites

You need npm or yarn installed, you should also have a SeeTrue instance runinng.

Installation

using npm:

npm install seetrue.client.react

using yarn:

yarn add seetrue.client.react

Usage

To access the context we have to init a provider, which will setup our client connection, it also checks the localstorage for a refresh token, and if it founds a refresh token it tries to refresh your session.

Setup

In the root of you application initialize the SeeTrueProvider.

  1. Import the SeeTrueProvider
import { SeeTrueProvider } from "seetrue.client.react";
  1. Initialize the SeeTrueProvider
  <SeeTrueProvider
    host="http://localhost:5000"
    audience="http://localhost:5000"
    tokenLifeTime={60000}
  >
    <App />
  </SeeTrueProvider>

| Prop | Type | Default value | Required | Description | |---------------|---------|---------------|----------|----------------------------------------------------------------------------------------------| | host | string | | true | The host of your SeeTrue.API instance | | audience | string | | true | A supported audience from your SeeTrue.API instance config | | tokenLifeTime | number? | 3600000 | false | Access token lifetime in miliseconds (also represents the background token refresh interval) |

Context usage

Import the hook

import { useSeeTrue } from "seetrue.client.react";

Use the hook:

const { isInitializing, isAuthenticated, user, client } = useSeeTrue();

| Prop | Type | Description | |-----------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | isInitializing | boolean | Initializing state, when you open the app, the app checks the refresh token then refreshes the user. While this initial check happens we cannot determinate if the user is logged in or not. We can show a loader | splash screen before we have a value which desribes the real authentication state. | | isAuthenticated | boolean? | It tells us if the user is logged in or not. Before the app is initialized the value is undefined, after it can be true or false based on the initialization process. | | user | object? | A user object providing account information about thr currently logged in user. Undefined if the user is not authenticated, docs | | client | object | A SeeTrue.Client instance, which enables us to interact with the SeeTrue.API docs |

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/TheOnlyBeardedBeast/SeeTrue