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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@restheart-cloud/kit

v0.1.9

Published

Signup and login for your frontend, plus email verification and password reset — with optional team invitations and multi-team switching, for RESTHeart Cloud.

Readme

@restheart-cloud/kit

Adds signup and login to your frontend — zero dependencies, works with Angular, React, Vue, or vanilla JS.

Covers every restheart-accounts flow: signup, login, email verification, password reset — plus team management for apps that need it: invitations, member roles, multi-team switching.

Pairs with RESTHeart Cloud, which gives you a production-ready backend — MongoDB, REST API, authentication, signup/signin, all managed.

Installation

npm install @restheart-cloud/kit

Usage

import { checkSession, login, logout } from '@restheart-cloud/kit';

const config = { apiBaseUrl: 'https://api.example.com' };

const user = await checkSession(config);  // UserInfo | null
await login(config, '[email protected]', 'secret');
await logout(config);

Authentication is handled via a Bearer token stored in localStorage — every authenticated request sends Authorization: Bearer <token>. No cookies are used.

The token is stored in localStorage and expires within 15 minutes. Sessions survive page reloads but don't persist across browser sessions if the token has expired.

Token refresh is fully transparent: the kit schedules a proactive renewal at 80% of the token's TTL (~12 minutes). As long as the tab stays open, the session stays alive without the app or user noticing.

Errors are thrown as { status: number; message: string }.

API

Auth

| Function | Description | |---|---| | checkSession(config) | Returns UserInfo if a valid token is held in memory, null otherwise | | register(config, payload) | Sign up — creates user and team | | verify(config, email, token) | Verify email after signup | | login(config, email, password) | Email/password login — stores token in memory | | logout(config) | Clears the token and cancels pending refresh |

Token management

| Function | Description | |---|---| | setToken(token) | Store a token manually (e.g. after OAuth redirect) | | getToken() | Read the current token, or null | | clearToken() | Clear the token and cancel any pending refresh | | scheduleRefresh(config) | Schedule proactive token renewal (called automatically by login) | | cancelRefresh() | Cancel a pending refresh timer |

Invitations

| Function | Description | |---|---| | invite(config, email, role) | Invite a user to the current team | | getInvitation(config, email, token) | Invitation metadata (org name, role, isNewUser) | | activate(config, payload) | Activate account for a newly invited user | | acceptInvite(config, token) | Accept invitation for an already registered user | | resendInvite(config, email) | Resend an expired invitation |

Password

| Function | Description | |---|---| | forgotPassword(config, email) | Request a reset link (always returns 202) | | resetPassword(config, payload) | Apply the reset token |

Multi-team

| Function | Description | |---|---| | getTeams(config) | List teams the authenticated user belongs to | | switchTeam(config, teamId) | Switch active team |

Types

interface AuthConfig {
  apiBaseUrl: string;
}

interface UserInfo {
  _id: string;
  roles: string[];
  team: string;
  teams?: TeamMembership[];
  profile?: { firstName?: string; lastName?: string; avatarUrl?: string };
}

interface TeamMembership {
  id: { $oid: string };
  name?: string;
  role: 'owner' | 'member';
  active?: boolean;
}

interface Invitation {
  email: string;
  teamName: string;
  role: 'owner' | 'member';
  isNewUser: boolean;
  expiresAt: string;
}

Framework adapters

  • Angular@restheart-cloud/kit-ng — signals, guards, interceptor
  • React → @restheart-cloud/kit-react (coming soon)