🤖 Chatbot
⚙️ Customization
Widget

YourGPT Chatbot SDK Documentation

Overview

This document provides a comprehensive guide on how to use the YourGPTChatbot SDK. The SDK provides a set of functions to interact with the chatbot.

Functions

on(event, callback)

This function allows you to listen to events from the chatbot.

Example

$yourgptChatbot.on("init", onInit); $yourgptChatbot.on("chatbotPopup", popupState);

execute(command)

This function allows you to execute commands on the chatbot.

Example

$yourgptChatbot.execute("chatbotOpen"); $yourgptChatbot.execute("chatbotClose");

set(key, value)

This function allows you to set data for the visitor or the session.

Example

$yourgptChatbot.set("visitor:data", { name: "Vis", email: "", }); $yourgptChatbot.set("session:data", { name: "Ses", email: "", });

off(event, callback)

This function allows you to stop listening to events from the chatbot.

Example

$yourgptChatbot.off("chatbotPopup", popupState);