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

@crownpeak/dqm-react-component

v1.3.0

Published

A React component for Crownpeak Digital Quality Management (DQM) integration

Readme

Crownpeak DQM React Component

npm version License: MIT TypeScript React

A React component library for integrating Crownpeak Digital Quality Management (DQM) into your React applications. Display quality analysis, accessibility violations, and checkpoint errors with visual highlighting capabilities.

🌟 Features

  • 🤖 AI-Powered Translation & Summary - Automatically translate analysis results into your language and generate intelligent summaries using OpenAI
  • 📊 Quality Analysis - Comprehensive quality metrics and scores
  • ♿ Accessibility Checks - WCAG compliance validation
  • 🎯 Error Highlighting - Visual highlighting of issues in HTML
  • 🎨 Material-UI Design - Beautiful, responsive sidebar interface
  • 🔐 Secure Authentication - Backend session management with secure credential storage
  • ⚡ Real-time Analysis - Live quality assessment as you edit
  • 📱 Responsive - Works on desktop, tablet, and mobile
  • 🌍 Internationalization - Supports English, German, and Spanish
  • 🔧 TypeScript Support - Full type definitions included

📦 Installation

npm install @crownpeak/dqm-react-component

🚀 Quick Start

import React, {useState} from 'react';
import {DQMSidebar} from '@crownpeak/dqm-react-component';

function App() {
    const [open, setOpen] = useState(false);

    const customHtml = `<html>
                <head><title>Test Page</title></head>
                <body>
                    <h1>Hello World</h1>
                    <img src="image.jpg" />
                </body>`

    return (
        <div>
            <button onClick={() => setOpen(true)}>Check Quality</button>

            <DQMSidebar
                open={sidebarOpen}
                onOpen={() => setOpen(true)}
                onClose={() => setOpen(false)}
                debugHtml={customHtml}
                config={{
                    // ... authentication options here
                    // look for "🔑 Authentication Setup" below
                }}
            />
        </div>
    );
}

export default App;

AI-Powered Translation & Summary (Quick Example)

import {DQMSidebar} from '@crownpeak/dqm-react-component';

<DQMSidebar
    open={isOpen}
    onClose={() => setIsOpen(false)}
    onOpen={() => setIsOpen(true)}
    config={{
        websiteId: 'your-website-id',
        apiKey: 'your-api-key',
        // Enable AI Translation (API key via localStorage: dqm_openai_apiKey)
        translation: {
            enabledByDefault: true,
            computeBudgetMs: 15000,   // 15s timeout for 'fast' mode
        },
        // Enable AI Summary (uses same OpenAI API key)
        summary: {
            timeoutMs: 30000,         // 30s timeout
        }
    }}
/>

See AI Features Guide for complete documentation including caching strategies and performance tuning.

📖 Documentation

Core Documentation

AI Features

Advanced

🔑 Authentication Setup

The component requires authentication with Crownpeak DQM. Two options are available:

import {DQMSidebar} from '@crownpeak/dqm-react-component';

<DQMSidebar
    {/* ... */}
    config={{
        // Option 1: Direct API Key and Website ID (not recommended for production)
        // websiteId: 'your-website-id',
        // apiKey: 'your-api-key',

        // Option 2: Auth Backend for API Key management (recommended)
        authBackendUrl: '', // Dev: empty (same origin) | Prod: 'https://your-backend.com'
        useLocalStorage: true,
    }}

Direct Backend Integration

Run the included backend server for session management:

npm run server

See AUTHENTICATION.md for detailed setup instructions.

🛠️ Development Server

For local development with test harness:

npm install
npm run dev

This starts:

  • Frontend + Backend on http://localhost:5173 (Vite dev server with integrated backend)
  • Backend routes (/auth/*, /dqm/*) handled by Vite plugin

Standalone Server (Optional)

If using the included backend server:

  • Node.js 18+ or 20+
  • Redis (for session storage)

See REDIS-SETUP.md for Redis installation.

📊 API Reference

DQMSidebar Props

| Prop | Type | Required | Description | |-------------|--------------|----------|------------------------------| | open | boolean | ✅ | Controls sidebar visibility | | onClose | () => void | ✅ | Callback when sidebar closes | | onOpen | () => void | ✅ | Callback when sidebar opens | | debugHtml | string | ❌ | HTML for testing (dev only) | | config | DQMConfig | ❌ | Configuration options |

DQMConfig Options

| Option | Type | Default | Description | |-------------------|-----------------|---------|------------------------------------------------| | apiKey | string | - | Direct API key (not for production) | | websiteId | string | - | Website ID for DQM | | authBackendUrl | string | - | Backend URL for session management | | useLocalStorage | boolean | true | Persist credentials in localStorage | | disabled | boolean | false | Disable DQM completely | | disableLogout | boolean | false | Hide the logout control (host manages session) | | shadowDomMode | boolean | false | Enable for Shadow DOM embedding | | overlayConfig | OverlayConfig | - | Overlay/toolbar detection config |

OverlayConfig (for Toolbars & Overlays)

Configure how the sidebar adapts to fixed overlays (e.g., admin toolbars):

<DQMSidebar
    config={{
        overlayConfig: {
            // CSS selector for the overlay element
            selector: 'iframe#MyToolbar',

            // Validate iFrame has contentWindow (default: true)
            validateIframe: true,

            // Polling interval in ms for cross-origin iFrames (default: 1000)
            pollMs: 1000,

            // OR: Manual offset when auto-detection doesn't work
            // (e.g., for iFrames that fill screen but have smaller internal content)
            manualOffset: {
                position: 'top', // 'top' | 'bottom' | 'left' | 'right'
                pixels: 50
            }
        }
    }}
/>

Common overlay configurations:

// Disable overlay detection
overlayConfig: {
    selector: null
}

// Manual 50px offset from top
overlayConfig: {
    manualOffset: {
        position: 'top', pixels: 50
    }
}

// Custom selector without iFrame validation
overlayConfig: {
    selector: '.admin-toolbar', validateIframe: false
}

Exported Types

import type {
    AnalysisState,
    Checkpoint,
    AnalysisData,
    DQMSidebarProps,
    DQMConfig,
    OverlayConfig,
    OverlayOffsetPosition
} from '@crownpeak/dqm-react-component';

// For advanced overlay handling
import {useOverlayResistant} from '@crownpeak/dqm-react-component';
import type {OverlayInfo, OverlayPosition} from '@crownpeak/dqm-react-component';

See TypeScript examples for full type definitions.

🧪 Testing

# Lint code
npm run lint

# Build library
npm run build:lib

# Test as package
npm pack
npm install ./crownpeak-dqm-react-component-1.0.0.tgz

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📜 License

MIT © Crownpeak Technology GmbH

See LICENSE file for details.

🐛 Issues

Found a bug or have a feature request? Please open an issue.

📞 Support

🔗 Links

📝 Changelog

See CHANGELOG.md for release history.


Made with ❤️ by the Crownpeak team