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

appsec-ui

v0.1.21

Published

Plug-and-play RBAC dashboard UI library for React/Next.js

Readme

AppSec UI Library

A plug-and-play RBAC (Role-Based Access Control) dashboard UI library for React/Next.js applications.

Features

  • RBAC Management: Complete user interface for managing roles, permissions, and access control
  • Onboarding Flow: Step-by-step setup wizard for configuring RBAC systems
  • API Caching: Built-in TanStack Query integration for efficient API response caching
  • Modern UI: Built with Tailwind CSS and Lucide React icons
  • TypeScript: Full TypeScript support with comprehensive type definitions

Installation

npm install appsec-ui

Quick Start

1. Set up providers

Wrap your application with the required providers:

import { RbacQueryProvider, AppsecProvider } from 'appsec-ui';

function App() {
  return (
    <RbacQueryProvider>
      <AppsecProvider
        appId="your-app-id"
        baseUrl="https://your-api-endpoint.com/api"
        appsecUrl="https://your-appsec-endpoint.com"
        mode="manage"
        getAuthToken={() => localStorage.getItem('authToken')}
      >
        {/* Your app content */}
      </AppsecProvider>
    </RbacQueryProvider>
  );
}

2. Use RBAC Management Component

import { RBACManagement } from 'appsec-ui';

function MyApp() {
  return (
    <div className="container mx-auto p-4">
      <RBACManagement />
    </div>
  );
}

TanStack Query Integration

This library uses TanStack Query (React Query) for efficient API caching and state management. The integration provides:

Automatic Caching

  • API responses are automatically cached for 5 minutes
  • Prevents unnecessary API calls on component re-renders
  • Background refetching keeps data fresh

Query Keys

The library uses structured query keys for cache management:

  • ['rbac', 'app', appId] - App information
  • ['rbac', 'modules', appMongoId] - Application modules
  • ['rbac', 'roles', appMongoId] - User roles
  • ['rbac', 'acls', appMongoId] - Access control lists
  • ['rbac', 'groups', appMongoId] - User groups

Mutation Handling

Mutations automatically invalidate related queries:

  • Creating/updating ACLs invalidates ACL queries
  • Bulk operations update the cache optimistically

Configuration

You can customize the query client behavior:

import { queryClient } from 'appsec-ui';

// Customize default options
queryClient.setDefaultOptions({
  queries: {
    staleTime: 10 * 60 * 1000, // 10 minutes
    retry: 1,
  },
});

API Requirements

Your backend API should provide the following endpoints:

  • GET /apps?name={appId} - Get app information
  • GET /modules?appId={appId} - Get application modules
  • GET /roles?appId={appId} - Get user roles
  • GET /acl?application={appId} - Get access control entries
  • GET /groups?appId={appId} - Get user groups
  • POST /acl - Create access control entry
  • DELETE /acl?_id={id} - Delete access control entry
  • PUT /acl/bulkUpdate - Bulk update access control entries

Components

RBACManagement

Main component for managing RBAC configuration.

<RBACManagement
  defaultTab="groups"
  className="custom-styles"
/>

OnboardingStepper

Step-by-step onboarding flow for setting up RBAC.

<OnboardingStepper
  onComplete={() => console.log('Onboarding complete')}
/>

Styling

This library uses Tailwind CSS with custom CSS variables for theming. Make sure to include Tailwind in your project:

npm install -D tailwindcss

The library uses these CSS custom properties:

  • --appsec-bg - Background color
  • --appsec-surface - Surface/card color
  • --appsec-border - Border color
  • --appsec-text - Primary text color
  • --appsec-text-secondary - Secondary text color

TypeScript Support

The library is written in TypeScript and provides comprehensive type definitions. All components and hooks are fully typed.

Browser Support

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

License

MIT