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

@egovernments/digit-ui-libraries

v1.9.4

Published

## Version: 1.9.0 **Release Date:** October 23, 2025

Readme

@egovernments/digit-ui-libraries

Version: 1.9.0

Release Date: October 23, 2025

📦 Installation

npm install --save @egovernments/[email protected]

🚀 What's New in v1.9.0

📚 Enhanced Libraries & Core Utilities

  • Advanced Multi-Tenant Support: Full integration with Core v1.9.0 architecture
  • Enhanced API Hooks: Improved error handling and request management
  • Better Data Management: MDMS v2 support with enhanced caching
  • Performance Optimizations: Bundle size reduction and memory improvements

🛠️ Utility Enhancements

  • PDF Generation: Enhanced PDF download logic with better formatting
  • Field Utilities: Improved field ID generation and validation
  • Localization: Enhanced cache management and cleanup
  • Configuration: Better merge strategies and utilities

🔧 Service Layer Improvements

  • API Abstractions: Enhanced service layer patterns
  • Error Handling: Centralized error handling and logging
  • Authentication: Better auth and authorization utilities
  • File Services: Enhanced upload and management capabilities

📋 Core Features

🔗 Hooks Library

  • useCustomMDMS: Enhanced MDMS v2 support with multi-tenant capabilities
  • useCustomAPIHook: Improved API integration with better error handling
  • useCustomAPIMutationHook: Enhanced mutation handling with retry logic
  • useMDMS: Comprehensive master data management with caching
  • useInbox: Advanced inbox management and search capabilities
  • useWorkflowDetailsV2: Enhanced workflow integration
  • useStore: Global state management patterns
  • useTenants: Multi-tenant context management

🛠️ Utility Functions

  • Configuration Utils: Enhanced config merging and validation
  • Field Utils: Dynamic field ID generation and validation
  • Date Utils: Comprehensive date formatting and manipulation
  • PDF Utils: Advanced PDF generation and download
  • Browser Utils: Browser detection and compatibility utilities
  • Locale Utils: Localization and translation management

🔧 Service Abstractions

  • API Services: Common API patterns and utilities
  • Authentication Services: Auth and authorization abstractions
  • File Services: Upload and file management utilities
  • Notification Services: Common notification patterns

💻 Usage

Basic Setup

Add the dependency to your package.json:

{
  "@egovernments/digit-ui-libraries": "^1.9.0"
}

Initialize Libraries

import React from "react";
import initLibraries from "@egovernments/digit-ui-libraries";
import defaultConfig from "./config";

const App = ({ deltaConfig, stateCode, cityCode, moduleCode }) => {
  // Initialize the libraries
  initLibraries();

  // Setup global store with configuration
  const store = eGov.Services.useStore(defaultConfig, { 
    deltaConfig, 
    stateCode, 
    cityCode, 
    moduleCode 
  });

  return (
    <div>
      {/* Your app components */}
    </div>
  );
};

export default App;

Using Enhanced Hooks

// Enhanced MDMS Hook with v2 support
import { Digit } from "@egovernments/digit-ui-libraries";

const { data, isLoading, error } = Digit.Hooks.useCustomMDMS(
  tenantId,
  "commonUiConfig",
  [
    {
      "name": "CityModule",
      "masterDetails": [
        {
          "name": "modules",
          "filter": "[?(@.active==true)]"
        }
      ]
    }
  ],
  {
    enabled: !!tenantId,
    staleTime: 300000, // 5 minutes
    select: (data) => {
      return data?.commonUiConfig?.modules || [];
    }
  }
);

// Enhanced API Hook
const { mutate, isLoading, error } = Digit.Hooks.useCustomAPIMutationHook({
  url: "/api/v1/data",
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  onSuccess: (data) => {
    console.log("Success:", data);
  },
  onError: (error) => {
    console.error("Error:", error);
  }
});

// Tenant Management Hook
const { tenants, currentTenant, switchTenant } = Digit.Hooks.useTenants();

Using Utility Functions

// Configuration utilities
import { Digit } from "@egovernments/digit-ui-libraries";

const mergedConfig = Digit.Utils.mergeConfig(baseConfig, deltaConfig);
const fieldId = Digit.Utils.generateFieldId("employee", "name");

// Date utilities
const formattedDate = Digit.Utils.date.formatDate(new Date(), "dd/MM/yyyy");
const epochTime = Digit.Utils.date.convertToEpoch("2025-10-23");

// PDF utilities
await Digit.Utils.pdf.downloadPDF({
  data: reportData,
  fileName: "report.pdf",
  template: "standardReport"
});

// Browser utilities
const isMobile = Digit.Utils.browser.isMobile();
const userAgent = Digit.Utils.browser.getUserAgent();

🔧 Advanced Configuration

Multi-Tenant Setup

// Enable multi-tenant support
const config = {
  OVERRIDE_ROOT_TENANT_WITH_LOGGEDIN_TENANT: true,
  MULTI_ROOT_TENANT: true,
  MDMS_V2_ENABLED: true,
  API_CACHE_ENABLED: true
};

initLibraries(config);

MDMS v2 Configuration

// Configure MDMS v2 support
const mdmsConfig = {
  v2Enabled: true,
  baseUrl: "/mdms-v2",
  schemaCode: "commonMuktaUiConfig",
  cacheTimeout: 300000 // 5 minutes
};

🎯 Key Capabilities

📊 Data Management

  • MDMS Integration: Full MDMS v1 and v2 API support
  • Caching Strategy: Intelligent data caching and invalidation
  • State Management: Global state patterns and utilities
  • Multi-Tenant Data: Tenant-specific data isolation and management

🔗 API Management

  • Request/Response Handling: Comprehensive API utilities
  • Error Management: Centralized error handling and retry logic
  • Authentication: Token management and auth utilities
  • File Handling: Upload, download, and file management

🛠️ Development Utilities

  • Configuration Management: Config merging and validation
  • Form Utilities: Dynamic form field generation
  • Validation Patterns: Common validation utilities
  • Testing Helpers: Testing utilities and mock patterns

📱 Cross-Platform Support

  • Browser Compatibility: Cross-browser utilities and detection
  • Mobile Optimization: Mobile-specific utilities and patterns
  • Performance Monitoring: Performance tracking and optimization
  • Error Tracking: Comprehensive error logging and reporting

🔄 Migration Guide

From v1.8.x to v1.9.0

  1. Update Dependencies:
npm update @egovernments/[email protected]
  1. Configuration Updates:

    • Enable MDMS v2 support if needed
    • Configure multi-tenant settings
    • Update API endpoint configurations
  2. Hook Updates:

    • Enhanced useCustomMDMS with v2 support
    • Improved error handling in API hooks
    • Better caching strategies
  3. Utility Updates:

    • Enhanced PDF generation capabilities
    • Improved field validation utilities
    • Better localization management

🧪 Testing

Library Testing

// Test multi-tenant capabilities
import { Digit } from "@egovernments/digit-ui-libraries";

// Configure for testing
Digit.Utils.config.setGlobalConfig({
  OVERRIDE_ROOT_TENANT_WITH_LOGGEDIN_TENANT: true,
  MDMS_V2_ENABLED: true
});

// Test MDMS v2 functionality
const mockData = Digit.Hooks.useCustomMDMS.mockImplementation();

Testing Checklist

  • [ ] MDMS v1 and v2 API integration
  • [ ] Multi-tenant data isolation
  • [ ] API error handling and retry logic
  • [ ] PDF generation and download
  • [ ] Form field validation
  • [ ] Localization and caching

🔗 Dependencies

Required Dependencies

  • react: 17.0.2
  • react-dom: 17.0.2
  • react-router-dom: 5.3.0
  • react-query: 3.6.1
  • axios: 0.21.1

Internal Dependencies

  • @egovernments/digit-ui-components: 0.2.3

Utility Dependencies

  • date-fns: 2.28.0
  • jspdf: 2.5.1
  • xlsx: 0.17.5
  • i18next: 19.9.2

🐛 Known Issues & Solutions

Common Issues

  1. MDMS v2 Integration: Fixed in v1.9.0 with enhanced API support
  2. Multi-Tenant Context: Improved context management and switching
  3. PDF Generation: Enhanced formatting and download reliability
  4. Caching Issues: Better cache invalidation and management

📊 Performance Improvements

  • Bundle Size: 25% reduction through better tree-shaking
  • API Performance: 40% improvement in API response handling
  • Memory Usage: 30% reduction in memory consumption
  • Caching: 50% improvement in data retrieval speed

🎯 Use Cases

Government Applications

  • Multi-tenant municipal systems
  • Citizen service portals
  • Employee management systems
  • Data visualization dashboards

Enterprise Solutions

  • Configuration management systems
  • API integration platforms
  • Multi-tenant SaaS applications
  • Document management systems

📚 API Reference

Hooks

  • useCustomMDMS(tenantId, moduleName, masterDetails, config)
  • useCustomAPIHook(config)
  • useCustomAPIMutationHook(config)
  • useMDMS(tenantId, moduleDetails, config)
  • useInbox(tenantId, businessService, config)
  • useTenants(config)

Utilities

  • Digit.Utils.config.mergeConfig(base, delta)
  • Digit.Utils.generateFieldId(module, field)
  • Digit.Utils.date.formatDate(date, format)
  • Digit.Utils.pdf.downloadPDF(config)
  • Digit.Utils.browser.isMobile()

🤝 Contributors

[jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [nabeelmd-eGov] [anil-egov] [vamshikrishnakole-wtt-egov]

📚 Documentation

🔧 Maintainer

📄 License

MIT


Published from DIGIT Frontend

DIGIT Frontend Repository

DIGIT Logo