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

@dbs-portal/module-tenant-management

v1.0.0

Published

Tenant management and multi-tenancy support module

Readme

@dbs-portal/module-tenant-management

A comprehensive multi-tenancy management module for DBS Portal, providing tenant CRUD operations, context switching, analytics, feature management, and backup/restore capabilities.

Features

🏢 Tenant Management

  • Complete CRUD operations for tenant entities
  • Tenant activation/deactivation with status tracking
  • Bulk operations for multiple tenants
  • Tenant cloning with configurable options
  • Connection string management and testing

🔄 Multi-Tenant Context

  • Seamless tenant switching with context preservation
  • Tenant-aware React context provider
  • Automatic tenant detection and validation
  • Tenant isolation and security boundaries

📊 Analytics & Monitoring

  • Comprehensive tenant analytics dashboard
  • Usage metrics and growth tracking
  • Performance monitoring and uptime statistics
  • Revenue analytics and user engagement metrics

⚙️ Feature Management

  • Dynamic feature flag management per tenant
  • Feature expiration and lifecycle management
  • Granular feature configuration with typed values
  • Feature dependency and requirement tracking

💾 Backup & Restore

  • Automated and manual backup creation
  • Multiple backup types (full, incremental, differential)
  • Backup scheduling and retention policies
  • One-click restore with data validation

🎨 Advanced UI Components

  • TenantDetail: Comprehensive tenant information display
  • TenantSwitcher: Multi-tenant context switcher with search
  • TenantAnalytics: Real-time analytics dashboard
  • TenantFeatureManager: Feature flag management interface
  • TenantBackupManager: Backup and restore operations
  • Tenant CRUD Operations: Create, read, update, and delete tenants
  • Feature Management: Configure tenant-specific features and limitations
  • Connection Management: Manage tenant database connections
  • Analytics Dashboard: Tenant usage statistics and analytics
  • Tenant Switching: Easy tenant context switching for administrators

Installation

yarn add @dbs-portal/module-tenant-management

Usage

import { 
  TenantList, 
  TenantForm, 
  TenantDetail,
  useTenants,
  TenantProvider 
} from '@dbs-portal/module-tenant-management'

// Wrap your app with TenantProvider
function App() {
  return (
    <TenantProvider>
      <TenantList />
    </TenantProvider>
  )
}

// Use tenant hooks
function TenantComponent() {
  const { data: tenants, isLoading } = useTenants()
  
  return (
    <div>
      {tenants?.map(tenant => (
        <div key={tenant.id}>{tenant.name}</div>
      ))}
    </div>
  )
}

Components

Core Components

  • TenantList - List all tenants with filtering and pagination
  • TenantForm - Create/edit tenant form with validation
  • TenantDetail - Detailed tenant information and statistics
  • TenantSwitcher - Tenant context switching component

Advanced Components

  • TenantFeatureManager - Manage tenant-specific features
  • TenantAnalytics - Tenant usage analytics dashboard
  • TenantConnectionManager - Database connection management
  • TenantBackupRestore - Backup and restore functionality

Hooks

Data Hooks

  • useTenants() - Fetch tenants with pagination
  • useTenant(id) - Fetch single tenant
  • useCreateTenant() - Create new tenant
  • useUpdateTenant() - Update existing tenant
  • useDeleteTenant() - Delete tenant

Feature Hooks

  • useTenantFeatures(id) - Manage tenant features
  • useTenantAnalytics(id) - Get tenant analytics
  • useTenantConnections(id) - Manage connections
  • useCurrentTenant() - Get current tenant context

Services

  • TenantService - Core tenant CRUD operations
  • TenantFeatureService - Feature management
  • TenantAnalyticsService - Analytics and reporting
  • TenantConnectionService - Connection management

Types

interface Tenant {
  id: string
  name: string
  displayName: string
  connectionString?: string
  isActive: boolean
  features: TenantFeature[]
  createdAt: Date
  updatedAt: Date
}

interface TenantFeature {
  name: string
  isEnabled: boolean
  value?: any
  expiresAt?: Date
}

Multi-tenancy Support

This module provides complete multi-tenancy support including:

  • Tenant Isolation: Complete data separation between tenants
  • Feature Flags: Per-tenant feature configuration
  • Resource Limits: Configurable limits per tenant
  • Analytics: Usage tracking and reporting
  • Backup/Restore: Tenant-specific data management

Dependencies

  • @dbs-portal/core-shared - Shared types and utilities
  • @dbs-portal/core-api - API client functionality
  • @dbs-portal/core-ui - UI components and themes
  • @dbs-portal/core-store - State management
  • @dbs-portal/core-auth - Authentication integration
  • @dbs-portal/module-identity - User and role management

License

MIT