1.1.9 • Published 10 months ago

enhancedocs-chat v1.1.9

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

npm version Downloads License: MIT Twitter npm.io

EnhanceDocs Chat

📦 Installing

Package manager

Using npm:

npm install enhancedocs-chat

Using yarn:

yarn add enhancedocs-chat

🚀 Usage

Getting Started

First you will need to create a project and a public key (pk_) in our Discord Channel. Then you can install the package and start using it 🎉🎉

Use your public key to enable the EnhanceDocs chat powered by AI:

import EnhancedChat from 'enhancedocs-chat';

import 'enhancedocs-chat/dist/style.css';

<EnhancedChat
  config={{
    projectId: "abc123", // <your-project-id>
    accessToken: "pk_abc123" // <your-access-token>
  }}
  {...props}
/>

Usage via script

Use the Chat component in any project, not just React. Load the CSS via style tag, refer to an element by id in your HTML and load EnhanceDocs script using a CDN for NPM:

  • unpkg: https://unpkg.com/enhancedocs-chat@1.0.0/dist/enhancedocs-chat.umd.js
  • jsdelivr: https://cdn.jsdelivr.net/npm/enhancedocs-chat@1.0.0/dist/enhancedocs-chat.umd.js

NOTE: You will need to load peer dependencies react and react-dom.

<link href="https://unpkg.com/enhancedocs-chat@1.0.0/dist/style.css" rel="stylesheet">

<script>
  document.addEventListener('DOMContentLoaded', () => {
    function loadScript(src, onLoadCallback) {
      const script = document.createElement('script');
      script.src = src;
      script.onload = onLoadCallback;
      document.head.appendChild(script);
    }

    function initEnhanceDocsChat() {
      EnhancedocsChat.renderChat('enhancedocs-chat', {
        config: {
          projectId: 'abc123', // <your-project-id>
          accessToken: 'pk_abc123' // <your-access-token>
        }
        // ...props
      });
    }

    loadScript('https://unpkg.com/react@18/umd/react.production.min.js', () => {
      loadScript('https://unpkg.com/react-dom@18/umd/react-dom.production.min.js', () => {
        loadScript('https://unpkg.com/enhancedocs-chat@1.0.0/dist/enhancedocs-chat.umd.js', initEnhanceDocsChat);
      });
    });
  })
</script>

<div id="enhancedocs-chat"></div>
1.1.9

10 months ago

1.1.8

10 months ago

1.1.7

10 months ago

1.1.6

10 months ago

1.1.5

11 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.1.4

11 months ago

1.1.3

12 months ago

1.1.2

12 months ago

1.0.0

12 months ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago