API
Setting Up In Page Chat

Getting Started:

To get up and running with Entelligence in doc chat, you'll need:

  • Entelligence API Key: Secure your access to the Entelligence API.
  • Repository Name: Specify the repository you wish to connect with.
  • Organization Name: Identify the organization associated with the repository.
  • Theme: Choose between a light or dark theme for the chat interface.
  • DisableArtifacts: Disable artifacts for in page chat. (Supported in Entelligence dashboard)
  • LimitSources: Set the number of sources to be displayed for each response

Properties

NameTypeDescriptionDefault
repoNamestringName of the github repository
organizationstringname of the github organization
apiKeystringapi key used to call the system
themestringtheme of the chatlight
disableArtifactsboolartifacts must be disabled for in page chatTrue
limitSourcesintrecommended top 33

Overview

This guide provides instructions for integrating the Entelligence AI script with both HTML and React applications. Follow the steps below to ensure proper integration and functionality.

Integrating with HTML

To integrate the Entelligence AI script with a standard HTML page, follow these steps:

Include the Script in Your HTML File

Add the following <script> tag to the <head> or <body> section of your HTML file, depending on when you want the script to load. Typically, placing it at the end of the <body> is preferred to ensure that the page content loads before the script.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- Add the script here -->
    <script src="https://d345f39z3arwqc.cloudfront.net/entelligence-chat.js"></script>
</head>
<body>
    <h1>Hello World</h1>
    <!-- Your content goes here -->
</body>
</html>

Initialize the Script

Add the following <script> tag to the <head> or <body> section of your HTML file, depending on when you want the script to load. Typically, placing it at the end of the <body> is preferred to ensure that the page content loads before the script.

<script type="module">
  window.EntelligenceChat.init({
    analyticsData: {
      repoName: "my-repo",
      organization: "my-org",
      apiKey: "1234567890",
      theme: "light"
      // Other data
    }
  });
</script>

Integrating with React

Create a React component or use an existing one where you want to integrate the script. For dynamic script loading, use useEffect to ensure it runs once the component mounts.

import React, { useEffect } from 'react';
 
const App = () => {
    useEffect(() => {
        const script = document.createElement('script');
        script.src = "https://d345f39z3arwqc.cloudfront.net/entelligence-chat.js";
        script.async = true;
        script.onload = () => {
            if (window.Entelligence) {
                window.Entelligence.init({
                    analyticsData: {
                        repoName: "my-repo",
                        organization: "my-org",
                        apiKey: "1234567890",
                        theme: "light",
                        disableArtifacts: True,
                        limitSources: 3,
                    }
                });
            }
        };
        document.body.appendChild(script);
 
        // Cleanup the script when component unmounts
        return () => {
            document.body.removeChild(script);
        };
    }, []);
 
    return (
        <div>
            <h1>Hello World</h1>
            {/* Your content goes here */}
        </div>
    );
};
 
export default App;

API key generation Endpoint

This document outlines the usage and setup of the /generateAPIKeyForOrg/ endpoint.

Getting Started

To get up and running with this endpoint, you'll need:

  • OrgUUID: Your organization uuid

Endpoint Properties

NameTypeDescriptionDefault
OrgUUIDstringyour organization uuid

How to call api key generation endpoint

curl --location 'https://entelligence.ddbrief.com/generateAPIKeyForOrg/' \
--header 'Content-Type: application/json' \
--data '{
  "OrgUUID": "qefqefwdqwdrewfewdqs",
}'