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

@ortha/admin-users

v0.0.4

Published

Users UI plugin for the Ortha admin application — provides user management pages with server-delegated filtering, cursor-based pagination, user detail profiles with sub-routing, and project assignment management.

Downloads

385

Readme

@ortha/admin-users

Users UI plugin for the Ortha admin application — provides user management pages with server-delegated filtering, cursor-based pagination, user detail profiles with sub-routing, and project assignment management.

Installation

Internal monorepo dependency — import directly:

import { usersPlugin, fetchUsers } from '@ortha/admin-users';
import type { User, UsersResponse, UsersParams } from '@ortha/admin-users';

Usage

Registering the plugin

import { bootstrap } from '@ortha/admin-platform-bootstrap';
import { usersPlugin } from '@ortha/admin-users';

bootstrap(document.getElementById('root')!, [
    usersPlugin()
    // ...other plugins
]);

Using API hooks

import {
    useUsers,
    useUser,
    useUpdateUser,
    useResetUserPassword
} from '@ortha/admin-users';

const UsersList = () => {
    const { data } = useUsers({ page: 1, limit: 20 });
    // data.items, data.pagination
};

const UserProfile = ({ id }: { id: string }) => {
    const { data: user } = useUser(id);
    const updateUser = useUpdateUser();
    const resetPassword = useResetUserPassword();
};

Cross-package user fetching

import { fetchUsers } from '@ortha/admin-users';

// Plain fetch function — used by other packages (e.g. projects team step)
const users = await fetchUsers({ search: 'john', limit: 10 });

Routes

| Path | Page | Description | | --------------------- | ----------------- | ------------------------------- | | /users | Users list page | Table with filters + pagination | | /users/:id/general | User general info | Profile sub-route | | /users/:id/projects | User projects | Project assignments |

API Reference

Plugin

| Export | Kind | Description | | --------------- | ------- | ------------------------------------------------- | | usersPlugin() | factory | Admin plugin — registers user routes and nav slot | | fetchUsers | fn | Plain fetch function for cross-package use |

Hooks

| Export | Kind | Description | | ----------------------- | ---- | ------------------------------------------ | | useUsers | hook | Users list query with pagination/filtering | | useUser | hook | Single user query | | useUsersStats | hook | Users stats query | | useUpdateUser | hook | Update user mutation | | useUpdateUserStatus | hook | Update user status mutation | | useUpdateUserProjects | hook | Bulk update user projects mutation | | useAddUserProject | hook | Add project to user mutation | | useRemoveUserProject | hook | Remove project from user mutation | | useResetUserPassword | hook | Reset user password mutation |

Query Keys

| Export | Kind | Description | | --------------- | ---- | --------------------------------------- | | usersKey | fn | Query key factory for users list cache | | usersStatsKey | fn | Query key factory for users stats cache | | userKey | fn | Query key factory for single user cache |

Types

| Export | Kind | Description | | --------------- | ---- | ------------------------------- | | User | type | User entity | | UserRole | type | User's role | | UserProject | type | User's project assignment | | UsersResponse | type | Paginated users response | | UsersParams | type | Query parameters for users list |

Filtering

The users table supports server-delegated filtering via QueryBuilder:

  • Status filter: active (isActive), inactive (deactivated, excludes pending), pending (has InviteCode)
  • Project filter: array column type with $exists + projectId conditions on UserProject relation
  • Filters are translated from QueryBuilder format to Sequelize-style JSON via filterTranslator

URL search params are the single source of truth for table state.

Internal Structure

src/lib/
├── usersPlugin/index.ts            # Plugin factory with route and slot registration
├── types/index.ts                  # Shared types (User, UserRole, UsersParams, etc.)
├── api/
│   ├── fetchUsers/index.ts         # Plain fetch function (cross-package use)
│   ├── useUsers/index.ts           # usersKey + useUsers query
│   ├── useUser/index.ts            # userKey + useUser query
│   ├── useUsersStats/index.ts      # usersStatsKey + useUsersStats query
│   ├── useUpdateUser/index.ts      # UpdateUserBody + mutation
│   ├── useUpdateUserStatus/index.ts
│   ├── useUpdateUserProjects/index.ts
│   ├── useAddUserProject/index.ts
│   ├── useRemoveUserProject/index.ts
│   └── useResetUserPassword/index.ts
├── hooks/
│   └── useUsersTable/index.ts      # Main table state hook (server-delegated)
├── utils/
│   └── filterTranslator/index.ts   # QueryBuilder → server filter JSON translation
├── pages/
│   └── UsersPage/index.tsx         # Main page component
└── components/                     # UI components (table, filters, stats, etc.)

Key Patterns

  • Route components are lazy-loaded with React.lazy().
  • API hooks use TanStack React Query and httpClient from @ortha/admin-platform-core.
  • Cursor-based pagination with prev/next navigation.
  • URL search params drive all table state (filters, sort, cursor).
  • Forms use react-hook-form with ajvResolver from @ortha/admin-utils.
  • Depends on the home plugin (uses the authenticated root layout).

Dependencies

  • @ortha/admin-platform-corehttpClient, slot constants, auth store
  • @ortha/admin-platform-plugin-registry — plugin types
  • @ortha/admin-utilsajvResolver, handleMutationError
  • @ortha/design-system — theme and UI components

Building

nx build admin-users