Installation
Features of website widget is in experimental stage. Please report any issues you encounter. Currently, only PUBLIC, existing, manually created projects are supported, with no authentication.
Introduction
The Gendox Chat Widget is the easiest way to integrate an AI chat system into your website, enabling direct integration with popular AI models such as OpenAI ChatGPT, Cohere, LLaMA, and others. This widget allows you to add advanced chatbot capabilities to your platform with minimal setup.
Getting Started
To begin using the Gendox Chat Widget, you must first create an account on the Gendox platform. Follow these steps:
- Create a Gendox Account.
- Create a Project and an Agent [link to guide].
- Upload Information [link to guide].
- Make the Project Public. (This step is crucial for the widget to function properly).
Once your agent has been created, navigate to the Gendox webapp homepage, click on your project, and retrieve the following from the browser's URL parameters:
organizationId
projectId
.
Installation
To install the Gendox widget on any website, simply add the following script to the <head>
section of your webpage:
<script
id="gendox-chat-script"
src="https://app.gendox.dev/gendox-sdk/gendox-widget-plugin.js"
data-gendox-src="https://app.gendox.dev"
data-organization-id="[organizationId]"
data-project-id="[projectId]">
</script>
Once this script is included, the Gendox widget will automatically appear in the bottom-right corner of your page.
Configuration
1. Styling
You can easily customize the appearance and position of the Gendox chat widget by overriding its default CSS styles using CSS specificity. For example, you can adjust the location of the chat bubble or window using the following CSS:
#gendox-chat-container-id.gendox-chat-container-position {
position: fixed;
bottom: 2rem;
right: 1rem;
z-index: 1000;
border-radius: 20px;
}
2. Parameters
The following parameters can be customized by passing them into the script:
Data Attribute | Description | Default Value | Example |
---|---|---|---|
data-gendox-src | The base URL for the Gendox chat embed source. | '' (empty string) | data-gendox-src="https://app.gendox.dev" |
data-organization-id | The unique identifier of your organization within Gendox. | '' (empty string) | data-organization-id="org_12345" |
data-project-id | The unique identifier of the specific project within Gendox. | '' (empty string) | data-project-id="proj_abcde" |
data-gendox-container-id | The ID assigned to the chat container element. Allows customization of the container element for styling or interaction purposes. | gendox-chat-container-id | data-gendox-container-id="custom-container-id" |
data-gendox-iframe-id | The ID assigned to the chat iframe element. Allows customization of the iframe element for styling or integration with other components. | gendox-chat-iframe-id | data-gendox-iframe-id="custom-iframe-id" |
More parameter configurations will be documented in future updates.
Events
The Gendox widget uses the Post Message API to exchange messages between the widget and the parent webpage. Developers can set up event listeners to receive notifications from the Gendox chat app and send information back to it.
Table of Events
Event Type | Description |
---|---|
gendox.events.initialization.request | Gendox requests initial configuration from the parent website. |
gendox.events.initialization.response | The agent sends a response message back to the user. |
gendox.events.embedded.chat.toggle.action | Event triggered when embedded chat iframe window is opened or closed. |
gendox.events.listener.removed | Event triggered when message listener from parent window has been removed from gendox. |
gendox.events.chat.message.new.sent | Event triggered when a message is sent from the user to the gendox chat for completion. |
gendox.events.chat.message.new.response.received | A completion response has been received. |
gendox.events.chat.message.context.local.request | Event triggered when gendox requests local context from the parent window. This can be the content of the page that the user is viewing, or the text selected, or whatever you want! |
gendox.events.chat.message.context.local.response | Gendox is waiting this events from the parent window. Whatever is sent will be included in the local context in the completion message. |
gendox.events.chat.message.tool_calls.request | List of Tools that the Agent wants to be executed in the frontend. |
gendox.events.chat.message.tool_calls.response | Not Supported Yet. The responses for the Tools the agent requested. This responses will be provided to the Agent to complete the response. |