Home
Home
German Version
Support
Impressum
26.5 Release ►

Start Chat with Collection

    Main Navigation

    • Preparation
      • Connectors
      • Create an InSpire VM on Hyper-V
      • Initial Startup for G7 appliances
      • Setup InSpire G7 primary and Standby Appliances
    • Datasources
      • Configuration - Atlassian Confluence Connector
      • Configuration - Atlassian Confluence REST Connector
      • Configuration - Best Bets Connector
      • Configuration - Box Connector
      • Configuration - Connector for GraphQL
      • Configuration - COYO Connector
      • Configuration - Data Integration Connector
      • Configuration - Database Connector
      • Configuration - Documentum Connector
      • Configuration - Dropbox Connector
      • Configuration - Egnyte Connector
      • Configuration - GitHub Connector
      • Configuration - Google Drive Connector
      • Configuration - GSA Adapter Service
      • Configuration - HL7 Connector
      • Configuration - IBM Lotus Connector
      • Configuration - Jira Connector
      • Configuration - JVM Launcher Service
      • Configuration - LDAP Connector
      • Configuration - Microsoft Azure Principal Resolution Service
      • Configuration - Microsoft Dynamics CRM Connector
      • Configuration - Microsoft Exchange Connector
      • Configuration - Microsoft File Connector (Legacy)
      • Configuration - Microsoft File Connector
      • Configuration - Microsoft Graph Connector
      • Configuration - Microsoft Loop Connector
      • Configuration - Microsoft Project Connector
      • Configuration - Microsoft SharePoint Connector
      • Configuration - Microsoft SharePoint Online Connector
      • Configuration - Microsoft Stream Connector
      • Configuration - Microsoft Teams Connector
      • Configuration - Salesforce Connector
      • Configuration - SCIM Principal Resolution Service
      • Configuration - SemanticWeb Connector
      • Configuration - ServiceNow Connector
      • Configuration - Web Connector V2
      • Configuration - Web Connector
      • Configuration - Yammer Connector
      • Data Integration Guide with SQL Database by Example
      • Indexing user-specific properties (Documentum)
      • Installation & Configuration - Atlassian Confluence Sitemap Generator Add-On
      • Installation & Configuration - Caching Principal Resolution Service
      • Installation & Configuration - Mindbreeze InSpire Insight Apps in Microsoft SharePoint On-Prem
      • Mindbreeze InSpire Insight Apps in Microsoft SharePoint Online
      • Mindbreeze Web Parts for Microsoft SharePoint
      • User Defined Properties (SharePoint 2013 Connector)
      • Whitepaper - Migration of Sites Selected Permissions for the MS SharePoint Online Connector
      • Whitepaper - Migration of Tenant-Wide Permissions for the MS SharePoint Online Connector
      • Whitepaper - Mindbreeze InSpire Insight Apps in Salesforce
      • Whitepaper - Overview of Connectors
      • Whitepaper - Web Connector - Setting Up Advanced Javascript Usecases
    • Configuration
      • CAS_Authentication
      • Configuration - Advanced Configuration for Mail Delivery
      • Configuration - Alerts
      • Configuration - Alternative Search Suggestions and Automatic Search Expansion
      • Configuration - Back-End Credentials
      • Configuration - Chinese Tokenization Plugin (Jieba)
      • Configuration - CJK Tokenizer Plugin
      • Configuration - Collected Results
      • Configuration - CSV Metadata Mapping Item Transformation Service
      • Configuration - Entity Recognition
      • Configuration - Exporting Results
      • Configuration - Filter Plugins
      • Configuration - GSA Late Binding Authentication
      • Configuration - Identity Conversion Service - Replacement Conversion
      • Configuration - InceptionImageFilter
      • Configuration - Index-Servlets
      • Configuration - InSpire AI Chat and Insight Services for Retrieval Augmented Generation
      • Configuration - Item Property Generator
      • Configuration - Japanese Language Tokenizer
      • Configuration - JavaScript Transformer Plugins
      • Configuration - Kerberos Authentication
      • Configuration - Management Center Menu
      • Configuration - Metadata Enrichment
      • Configuration - Metadata Reference Builder Plugin
      • Configuration - Mindbreeze Proxy Environment (Remote Connector)
      • Configuration - Personalized Relevance
      • Configuration - Plugin Installation
      • Configuration - Principal Validation Plugin
      • Configuration - Profile
      • Configuration - Reporting Query Logs
      • Configuration - Reporting Query Performance Tests
      • Configuration - Request Header Session Authentication
      • Configuration - Shared Configuration (Windows)
      • Configuration - Vocabularies for Synonyms and Suggest
      • Configuration of Thumbnail Images
      • Cookie-Authentication
      • Documentation - Mindbreeze InSpire
      • I18n Item Transformation
      • Installation & Configuration - Outlook Add-In
      • Installation - GSA Base Configuration Package
      • JWT Authentication
      • Language detection - LanguageDetector Plugin
      • Mindbreeze Personalization
      • Mindbreeze Property Expression Language
      • Mindbreeze Query Expression Transformation
      • SAML-based Authentication
      • Trusted Peer Authentication for Mindbreeze InSpire
      • Using the InSpire Snapshot for Development in a CI_CD Scenario
      • Whitepaper - AI Chat
      • Whitepaper - Create a Google Compute Cloud Virtual Machine InSpire Appliance
      • Whitepaper - Create a Microsoft Azure Virtual Machine InSpire Appliance
      • Whitepaper - Create AWS 10M InSpire Appliance
      • Whitepaper - Create AWS 1M InSpire Appliance
      • Whitepaper - Create AWS 2M InSpire Appliance
      • Whitepaper - Create Oracle Cloud 10M InSpire Application
      • Whitepaper - Create Oracle Cloud 1M InSpire Application
      • Whitepaper - MMC_ Services
      • Whitepaper - Single Sign-On with Microsoft Entra ID or Active Directory Federation Services
      • Whitepaper - Text Classification Insight Services
    • Operations
      • Adjusting the InSpire Host OpenSSH Settings - Set LoginGraceTime to 0 (Mitigation for CVE-2024-6387)
      • app.telemetry Statistics Regarding Search Queries
      • Blacklisting vulnerable kernel modules esp4, esp6, rxrpc - (Mitigation for CVE-2026-43284 _ DirtyFrag)
      • CIS Level 2 Hardening - Setting SELinux to Enforcing mode
      • Configuration - app.telemetry dashboards for usage analysis
      • Configuration - Usage Analysis
      • Disabling algif_aead_init - (Mitigation for CVE-2026-31431)
      • FAQ - Creating Mindbreeze InSpire Appliances on Hyper Scalers
      • Handbook - Backup & Restore
      • Handbook - Command Line Tools
      • Handbook - Distributed Operation (G7)
      • Handbook - Filemanager
      • Handbook - Indexing and Search Logs
      • Handbook - Updates and Downgrades
      • Index Operating Concepts
      • Inspire Diagnostics and Resource Monitoring
      • Provision of app.telemetry Information on G7 Appliances via SNMPv3
      • Restoring to As-Delivered Condition
      • Whitepaper - Administration of Insight Services for Retrieval Augmented Generation
      • Whitepaper - Insight Workplace
      • Whitepaper - Mindbreeze in Microsoft Teams
      • Whitepaper - Mindbreeze in OpenAI ChatGPT
      • Whitepaper - Mindbreeze InSpire LLM_ A Kubernetes Integration Guide
      • Whitepaper - Mindbreeze InSpire LLM_ On-Premise Deployment Guide
      • Whitepaper - Natural Language Question Answering (NLQA)
      • Whitepaper - Overview AI based Document Parsing, Transcriptions, and Semantic Index Pipeline
      • Whitepaper - Overview of Agentic AI and the Insight Workplace
      • Whitepaper - Using the Mindbreeze InSpire MCP Server
    • User Manual
      • Browser Extension
      • Cheat Sheet
      • iOS App
      • Keyboard Operation
    • SDK
      • api.chat.v1beta.generate Interface Description
      • api.v2.alertstrigger Interface Description
      • api.v2.export Interface Description
      • api.v2.personalization Interface Description
      • api.v2.search Interface Description
      • api.v2.suggest Interface Description
      • api.v3.admin.SnapshotService Interface Description
      • Debugging (Eclipse)
      • Developing an API V2 search request response transformer
      • Developing Item Transformation and Post Filter Plugins with the Mindbreeze SDK
      • Developing Item Transformation Launched Service with Mindbreeze SDK
      • Developing of Insight Apps with React
      • Development of a Query Expression Transformer
      • Development of Insight Apps
      • Embedding the Insight App Designer
      • Export and Integration of Personalization and Analytics Data with External Platforms
      • Java API Interface Description
      • OpenAPI Interface Description
      • SDK Overview
    • Release Notes
      • Release Notes 20.1 Release - Mindbreeze InSpire
      • Release Notes 20.2 Release - Mindbreeze InSpire
      • Release Notes 20.3 Release - Mindbreeze InSpire
      • Release Notes 20.4 Release - Mindbreeze InSpire
      • Release Notes 20.5 Release - Mindbreeze InSpire
      • Release Notes 21.1 Release - Mindbreeze InSpire
      • Release Notes 21.2 Release - Mindbreeze InSpire
      • Release Notes 21.3 Release - Mindbreeze InSpire
      • Release Notes 22.1 Release - Mindbreeze InSpire
      • Release Notes 22.2 Release - Mindbreeze InSpire
      • Release Notes 22.3 Release - Mindbreeze InSpire
      • Release Notes 23.1 Release - Mindbreeze InSpire
      • Release Notes 23.2 Release - Mindbreeze InSpire
      • Release Notes 23.3 Release - Mindbreeze InSpire
      • Release Notes 23.4 Release - Mindbreeze InSpire
      • Release Notes 23.5 Release - Mindbreeze InSpire
      • Release Notes 23.6 Release - Mindbreeze InSpire
      • Release Notes 23.7 Release - Mindbreeze InSpire
      • Release Notes 24.1 Release - Mindbreeze InSpire
      • Release Notes 24.2 Release - Mindbreeze InSpire
      • Release Notes 24.3 Release - Mindbreeze InSpire
      • Release Notes 24.4 Release - Mindbreeze InSpire
      • Release Notes 24.5 Release - Mindbreeze InSpire
      • Release Notes 24.6 Release - Mindbreeze InSpire
      • Release Notes 24.7 Release - Mindbreeze InSpire
      • Release Notes 24.8 Release - Mindbreeze InSpire
      • Release Notes 25.1 Release - Mindbreeze InSpire
      • Release Notes 25.2 Release - Mindbreeze InSpire
      • Release Notes 25.3 Release - Mindbreeze InSpire
      • Release Notes 25.4 Release - Mindbreeze InSpire
      • Release Notes 25.5 Release - Mindbreeze InSpire
      • Release Notes 25.6 Release - Mindbreeze InSpire
      • Release Notes 25.7 Release - Mindbreeze InSpire
      • Release Notes 25.8 Release - Mindbreeze InSpire
      • Release Notes 26.1 Release - Mindbreeze InSpire
      • Release Notes 26.2 Release - Mindbreeze InSpire
      • Release Notes 26.3 Release - Mindbreeze InSpire
      • Release Notes 26.4 Release - Mindbreeze InSpire
      • Release Notes 26.5 Release - Mindbreeze InSpire
    • Security
      • Known Vulnerablities
    • Product Information
      • Product Information - Mindbreeze InSpire - Standby
      • Product Information - Mindbreeze InSpire
    Home

    Path

    Sure, you can handle it. But should you?
    Let our experts manage the tech maintenance while you focus on your business.
    See Consulting Packages

    Developing of Insight Apps with React

    IntroductionPermanent link for this heading

    @mindbreeze.com/client-react is a React NPM library that provides the necessary functions to initialize an Insight App, perform search requests, and handle result responses. The library exposes a top-level InsightApp component for initialization, React hooks for search state management, result fetching, and rendering utilities for result properties.

    InstallationPermanent link for this heading

    Install the PackagePermanent link for this heading

    Install using your preferred package manager:

    # yarn

    yarn add @mindbreeze.com/client-react

    # npm

    npm add @mindbreeze.com/client-react

    TypeScript TypesPermanent link for this heading

    For TypeScript support, install the types package. All types are available under the Mindbreeze namespace.

    npm add @mindbreeze.com/client-types

    import { Mindbreeze } from '@mindbreeze.com/client-types';

    AWS CodeArtifact SetupPermanent link for this heading

    The package is hosted on AWS CodeArtifact. Follow these steps to configure access.

    Step 1 — Create an IAM UserPermanent link for this heading

    Create an IAM User and provide the User ID to the Mindbreeze team. The Mindbreeze team will add the user to the repository.

    Step 2 — Attach an IAM PolicyPermanent link for this heading

    Once added, attach the following inline policy to the IAM user (Permissions tab → Add permissions → Create inline policy → JSON):

    {

      "Version": "2012-10-17",

      "Statement": [{

        "Effect": "Allow",

        "Action": [

          "codeartifact:GetAuthorizationToken",

          "codeartifact:ReadFromRepository",

          "codeartifact:GetRepositoryEndpoint",

          "codeartifact:GetPackageVersionAsset",

          "sts:GetServiceBearerToken"

        ],

        "Resource": "*"

      }]

    }

    Name the policy (e.g. MyCompanyCodeArtifactAccess) and click Create policy.

    Step 3 — Generate an Authorization TokenPermanent link for this heading

    Run the following AWS CLI command to obtain an authorization token. The output is your authentication token.

    aws codeartifact get-authorization-token \

      --domain DOMAIN_NAME \

      --domain-owner ACCOUNT_ID \

      --region REGION \

      --profile your-user-profile \

      --query authorizationToken \

      --output text

    Step 4 — Configure .npmrcPermanent link for this heading

    Add the following to your project’s .npmrc file, replacing CODEARTIFACT_TOKEN with the token from the previous step:

    @mindbreeze.com:registry=https://mindbreeze-349188031343.d.codeartifact.eu-central-1.amazonaws.com/npm/mindbreeze/

    //mindbreeze-349188031343.d.codeartifact.eu-central-1.amazonaws.com/npm/mindbreeze/:always-auth=true

    //mindbreeze-349188031343.d.codeartifact.eu-central-1.amazonaws.com/npm/mindbreeze/:_authToken=${CODEARTIFACT_TOKEN}

    ComponentsPermanent link for this heading

    InsightAppPermanent link for this heading

    The root component that initializes the Mindbreeze client and provides context to all child components. All application components must be rendered as children of InsightApp.

    Type DefinitionPermanent link for this heading

    type Props = {

      mindbreezeUrl: string;          // URL to the Mindbreeze client service

      mindbreezeRequire?: any;        // Existing Mindbreeze Require instance

      applicationOptions?: any;       // Options passed to the application on init

      loadStyles?: boolean;           // Load Mindbreeze styles. Default: false

      scriptUrl?: string;             // Path to client.js. Default: /apps/scripts/client.js

    }

    Note: Either mindbreezeUrl or mindbreezeRequire must be provided.

    UsagePermanent link for this heading

    const mindbreezeUrl = process.env.NEXT_PUBLIC_MINDBREEZE_URL || "";

    <InsightApp

      mindbreezeUrl={mindbreezeUrl}

      applicationOptions={{ startSearch: true, _sources: [] }}

    >

      <SearchContent />

    </InsightApp>

    HooksPermanent link for this heading

    useMindbreezePermanent link for this heading

    Returns the core Mindbreeze context including the client web components and application provider. Use this hook to access lower-level APIs or pass context to other hooks.

    const { clientWebComponents, applicationProvider, application } = useMindbreeze();

    useSearchPermanent link for this heading

    Manages search state and exposes search actions. Returns a tuple of SearchState and SearchAction.

    SignaturePermanent link for this heading

    export const useSearch = (

      clientWebComponents: any,

      applicationProvider: ApplicationProvider | null,

      options?: UseSearchOptions

    ) : [Mindbreeze.SearchState, Mindbreeze.SearchAction]

    UseSearchOptionsPermanent link for this heading

    export type UseSearchOptions = {

      firstPageNumber?: number;   // Starting page number (e.g. 1)

      maxPageCount?: number;      // Maximum number of pages to return

      count?: number;             // Number of results per page

      constraints?: any;          // Additional search constraints

    };

    SearchStatePermanent link for this heading

    SearchState {

      searchModel: any;

      computing: boolean;         // true while a search request is in-flight

      estimatedCount: number;     // Total estimated result count

      pageCount: number;          // Total number of pages

      pageNumber: number;         // Current page number

      pageSize: number;           // Results per page

    }

    SearchActionPermanent link for this heading

    setPage(page: number): void;               // Navigate to a page

    setPageSize(size: number): void;           // Change results per page

    setUnparsedUserQuery(input: string): void; // Update the search query

    useResultsPermanent link for this heading

    Fetches search results and tracks loading state.

    SignaturePermanent link for this heading

    export const useResults = (

      clientWebComponents: any,

      applicationProvider: ApplicationProvider | null,

      options?: Mindbreeze.ResultControllerOptions

    ) : ResultInfo

    ResultInfoPermanent link for this heading

    type ResultInfo = {

      results: Mindbreeze.ResultProperties[];  // Array of result objects

      computing: boolean;                      // true while fetching

    };

    ExamplesPermanent link for this heading

    Search PagePermanent link for this heading

    A complete search page with a search bar, results list, and pagination. Child components consume useMindbreeze to access the context provided by InsightApp.

    export const SearchContent = () => {

      const { clientWebComponents, applicationProvider } = useMindbreeze();

      const [searchState, searchAction] = useSearch(

        clientWebComponents, applicationProvider,

        { firstPageNumber: 1, maxPageCount: 100 }

      );

      const handleSearch = (event: any) => {

        searchAction.setUnparsedUserQuery(event.target.value);

      };

      return (

        <>

          <SearchBar onSearch={handleSearch} placeholder="Search..." />

          <Results />

          <Pagination

            selectedPage={searchState.pageNumber}

            total={searchState.estimatedCount}

            pageSize={searchState.pageSize}

            pageSizeOptions={[5, 10, 15, 20, 50, 100]}

            onSizeChanged={(size) => searchAction.setPageSize(size)}

            onPageChanged={(page) => searchAction.setPage(page)}

          />

        </>

      );

    };

    Results ComponentPermanent link for this heading

    Renders search results using useResults. The ResultPropertyRendering and DefaultRenderContext classes handle property rendering.

    export default function Results() {

      const { applicationProvider, clientWebComponents } = useMindbreeze();

      const search = useResults(clientWebComponents, applicationProvider, {

        requestedProperties: { actions: { formats: ['PROPERTY'] } },

      });

      const renderer = new ResultPropertyRendering();

      const ctx = new DefaultRenderContext();

      return (

        <div>

          {search.computing && <Spinner />}

          {search.results.map((result) => (

            <h3>{result.title.render(ctx, renderer)}</h3>

          ))}

        </div>

      );

    }

    Custom Result RendererPermanent link for this heading

    Extend DefaultHTMLRenderer to customize how result properties, actions, and text extracts are rendered.

    class MyRenderer extends DefaultHTMLRenderer {

      renderNamedAction(context: RenderContext, action: PropertyAction) {

        if (action.valueType === 'link') {

          return <Button onClick={() => window.open(action.href)}>{action.label}</Button>;

        }

        return null;

      }

      renderTextExtracts(context: RenderContext, textExtracts: TextExtracts) {

        const item = textExtracts.items[0];

        return <Card><div>{item.propertyName}</div>

          {this.renderTextExtract(context, item.value) as ReactNode}</Card>;

      }

      renderTextExtract(context: RenderContext, textExtract: TextExtract): ReactNode {

        if (textExtract.typeName === "textsnippets") {

          return <div>{this.renderStructuredText(context, textExtract.content) as ReactNode}</div>;

        }

      }

    }

    Render result actions within a result item:

    const renderer = new MyRenderer();

    const ctx = new DefaultRenderContext();

    {result.actions && <div>{result.actions.render(ctx, renderer)}</div>}

    Download PDF

    • Developing of Insight Apps with React

    Content

    • Introduction
    • Installation
    • Components
    • Hooks
    • Examples

    Download PDF

    • Developing of Insight Apps with React