Nebulous Puffy Marshmallows

    @ibm-watson/discovery-react-components
    TypeScript icon, indicating that this package has built-in type declarations

    1.4.0-beta.7 • Public • Published

    @ibm-watson/discovery-react-components

    NPM JavaScript Style Guide

    Install

    npm install --save @ibm-watson/discovery-react-components

    Usage

    // src/App.js
    import React from 'react';
    import {
      DiscoverySearch,
      SearchInput,
      SearchResults,
      SearchFacets,
      ResultsPagination,
      DocumentPreview
    } from '@ibm-watson/discovery-react-components';
    import { CloudPackForDataAuthenticator, DiscoveryV2 } from 'ibm-watson';
    
    // optionally import SASS styles
    import '@ibm-watson/discovery-styles/scss/index.scss';
    // or load vanilla CSS
    // import '@ibm-watson/discovery-styles/css/index.css';
    
    // Replace these values
    const username = '<your cluster username>';
    const password = '<your cluster password>';
    const url = '<your cluster url>';
    const serviceUrl = '<your discovery url>';
    const version = '<YYYY-MM-DD discovery version>';
    const projectId = '<your discovery project id>';
    
    const App = () => {
      const authenticator = new CloudPakForDataAuthenticator({ username, password, url });
      const searchClient = new DiscoveryV2({ url: serviceUrl, version, authenticator });
    
      return (
        <DiscoverySearch searchClient={searchClient} projectId={'<your discovery project id>'}>
          <SearchInput />
          <SearchResults />
          <SearchFacets />
          <ResultsPagination />
          <DocumentPreview />
        </DiscoverySearch>
      );
    };

    Keywords

    none

    Install

    npm i @ibm-watson/discovery-react-components

    DownloadsWeekly Downloads

    287

    Version

    1.4.0-beta.7

    License

    Apache-2.0

    Unpacked Size

    6.13 MB

    Total Files

    124

    Last publish

    Collaborators

    • germanattanasio
    • mamoonraja
    • watdevex
    • neig
    • jhpedemonte