### Setup Messenger Integration using ChatbotKit Node SDK Source: https://context7_llms This function sets up a Messenger integration. It requires the ChatbotKit client and integration details as input. The output is the setup integration object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function setupMessengerIntegration() { const response = await kit.messenger.v1.setup({ // integration details }); console.log(response); } ``` -------------------------------- ### Setup Email Integration using ChatbotKit Node SDK Source: https://context7_llms This function sets up an email integration. It requires the ChatbotKit client and integration details as input. The output is the setup integration object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function setupEmailIntegration() { const response = await kit.email.v1.setup({ // integration details }); console.log(response); } ``` -------------------------------- ### Partner User Token Client Initialization in ChatbotKit Node SDK Source: https://context7_llms Illustrates the setup of the PartnerUserTokenClient for managing authentication tokens for partner users. This client depends on an initialized PartnerClient. ```typescript import { PartnerClient } from "@chatbotkit/sdk/partner/classes/PartnerClient"; import { PartnerUserTokenClient } from "@chatbotkit/sdk/partner/user/token/classes/PartnerUserTokenClient"; // Assume PartnerClient is already initialized const apiKey = "YOUR_API_KEY"; const partnerClient = new PartnerClient({ apiKey }); const partnerUserTokenClient = new PartnerUserTokenClient(partnerClient); console.log("PartnerUserTokenClient initialized successfully."); // This client can be used for token creation, deletion, and listing. ``` -------------------------------- ### Create a Conversation using ChatbotKit SDK Source: https://context7_llms This function initiates a new conversation. It can be used to start a chat session with a contact or agent. Returns the created conversation object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ // ... }); async function createConversationExample() { const conversation = await kit.conversation.v1.createConversation({ // optional initial prompt or context }); console.log(conversation); } ``` -------------------------------- ### Create a Bot Session (TypeScript) Source: https://context7_llms Starts a new session for a specific bot. Bot sessions are used to maintain conversation context. Requires the bot ID and potentially initial user input or context. Returns the created session object. ```typescript import { BotSessionClient } from "@chatbotkit/sdk/bot/session"; // Assuming 'client' is an initialized ChatBotKitClient instance const botSessionClient = new BotSessionClient(client); async function startBotSession(botId: string) { const session = await botSessionClient.v1.createBotSession(botId, { // Optional initial message or context // message: "Hello, I need help." }); console.log("Bot session created:", session); } ``` -------------------------------- ### CLI Color Formatting Source: https://context7_llms The @chatbotkit/cli/color module provides functions for adding color to terminal output. The 'formatBlue' function is an example of how to apply specific colors to text, enhancing CLI user experience. ```typescript import { formatBlue } from '@chatbotkit/cli/color/functions/formatBlue'; // Example usage: // const coloredText = formatBlue('This is blue text'); // console.log(coloredText); ``` -------------------------------- ### Platform Content Tutorial Client Initialization in ChatbotKit Node SDK Source: https://context7_llms Shows the initialization of the PlatformContentTutorialClient for managing tutorial content on the platform. This client requires a PlatformClient instance. ```typescript import { PlatformClient } from "@chatbotkit/sdk/platform/classes/PlatformClient"; import { PlatformContentTutorialClient } from "@chatbotkit/sdk/platform/content/tutorial/classes/PlatformContentTutorialClient"; // Assume PlatformClient is already initialized const apiKey = "YOUR_API_KEY"; const platformClient = new PlatformClient({ apiKey }); const platformContentTutorialClient = new PlatformContentTutorialClient(platformClient); console.log("PlatformContentTutorialClient initialized successfully."); // Use this client for operations related to platform tutorial content. ``` -------------------------------- ### Initialize ChatBotKit Client (TypeScript) Source: https://context7_llms Demonstrates how to initialize the main ChatBotKit client with API keys and other options. This client is the entry point for accessing all other SDK functionalities. ```typescript import { ChatBotKitClient } from "@chatbotkit/sdk/client"; const client = new ChatBotKitClient({ apiKey: "YOUR_API_KEY", // Other options can be provided here }); ``` -------------------------------- ### List All Blueprints (TypeScript) Source: https://context7_llms Retrieves a list of all available blueprints using the BlueprintClient. This function is useful for getting an overview of all managed blueprints. It returns an array of blueprint objects. ```typescript import { BlueprintClient } from "@chatbotkit/sdk/blueprint"; // Assuming 'client' is an initialized ChatBotKitClient instance const blueprintClient = new BlueprintClient(client); async function listAllBlueprints() { const blueprints = await blueprintClient.v1.listBlueprints(); console.log("Available blueprints:", blueprints); } ``` -------------------------------- ### Create a Bot (TypeScript) Source: https://context7_llms Initializes a new bot instance using the BotClient. This involves providing essential details for the bot, such as its name and potentially a description or associated blueprint. Returns the created bot object. ```typescript import { BotClient } from "@chatbotkit/sdk/bot"; // Assuming 'client' is an initialized ChatBotKitClient instance const botClient = new BotClient(client); async function createNewBot() { const bot = await botClient.v1.createBot({ name: "My New Chatbot", description: "A bot for customer service." }); console.log("Bot created:", bot); } ``` -------------------------------- ### Platform Content Manual Client Initialization in ChatbotKit Node SDK Source: https://context7_llms Shows the initialization of the PlatformContentManualClient for managing manual content on the platform. This client requires an instance of PlatformClient. ```typescript import { PlatformClient } from "@chatbotkit/sdk/platform/classes/PlatformClient"; import { PlatformContentManualClient } from "@chatbotkit/sdk/platform/content/manual/classes/PlatformContentManualClient"; // Assume PlatformClient is already initialized const apiKey = "YOUR_API_KEY"; const platformClient = new PlatformClient({ apiKey }); const platformContentManualClient = new PlatformContentManualClient(platformClient); console.log("PlatformContentManualClient initialized successfully."); // Use this client for operations related to platform manual content. ``` -------------------------------- ### Update a Conversation using ChatbotKit SDK Source: https://context7_llms This function updates an existing conversation, for example, to change its status or add metadata. Requires the conversation ID and update payload. Returns the updated conversation object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ // ... }); async function updateConversationExample() { const conversationId = "some-conversation-id"; const updatedConversation = await kit.conversation.v1.updateConversation(conversationId, { // update payload, e.g., status: "completed" }); console.log(updatedConversation); } ``` -------------------------------- ### Authenticate Secret (TypeScript) Source: https://context7_llms Verifies a secret token to authenticate a request or identify a user/service. This is a security function often used during initial setup or sensitive operations. Requires the secret identifier. Returns authentication status or token details. ```typescript import { SecretClient } from "@chatbotkit/sdk/contact/secret"; // Assuming 'client' is an initialized ChatBotKitClient instance const secretClient = new SecretClient(client); async function authenticateWithSecret(secretId: string) { const authResult = await secretClient.v1.authenticateSecret(secretId); console.log("Authentication result:", authResult); } ``` -------------------------------- ### Platform Content Doc Client Initialization in ChatbotKit Node SDK Source: https://context7_llms Shows the initialization of the PlatformContentDocClient for managing documentation content on the platform. This client requires a PlatformClient instance. ```typescript import { PlatformClient } from "@chatbotkit/sdk/platform/classes/PlatformClient"; import { PlatformContentDocClient } from "@chatbotkit/sdk/platform/content/doc/classes/PlatformContentDocClient"; // Assume PlatformClient is already initialized const apiKey = "YOUR_API_KEY"; const platformClient = new PlatformClient({ apiKey }); const platformContentDocClient = new PlatformContentDocClient(platformClient); console.log("PlatformContentDocClient initialized successfully."); // Use this client for operations related to platform documentation. ``` -------------------------------- ### Platform Action Client Initialization in ChatbotKit Node SDK Source: https://context7_llms Demonstrates the initialization of the PlatformActionClient for managing platform actions. This client depends on an initialized PlatformClient. ```typescript import { PlatformClient } from "@chatbotkit/sdk/platform/classes/PlatformClient"; import { PlatformActionClient } from "@chatbotkit/sdk/platform/action/classes/PlatformActionClient"; // Assume PlatformClient is already initialized const apiKey = "YOUR_API_KEY"; const platformClient = new PlatformClient({ apiKey }); const platformActionClient = new PlatformActionClient(platformClient); console.log("PlatformActionClient initialized successfully."); // This client can be used for actions related to the platform. ``` -------------------------------- ### Partner Client Initialization in ChatbotKit Node SDK Source: https://context7_llms Demonstrates how to initialize the PartnerClient for interacting with partner-related functionalities in the ChatbotKit SDK. This client is essential for managing partner accounts and associated resources. ```typescript import { PartnerClient } from "@chatbotkit/sdk/partner/classes/PartnerClient"; // Assuming you have an API key and other necessary configurations const apiKey = "YOUR_API_KEY"; const partnerClient = new PartnerClient({ apiKey }); console.log("PartnerClient initialized successfully."); // You can now use partnerClient to access other partner-related functionalities. ``` -------------------------------- ### List Platform Content Manuals in ChatbotKit Node SDK Source: https://context7_llms Fetches a list of all manual content items available on the platform. Optional parameters can be used for filtering or pagination. ```typescript import { listPlatformContentManuals, type ListPlatformContentManualsCommandInput } from "@chatbotkit/sdk/platform/content/manual/v1/functions/listPlatformContentManuals"; async function handleListPlatformContentManuals(params?: ListPlatformContentManualsCommandInput) { try { const manuals = await listPlatformContentManuals(params); console.log("List of platform content manuals:", manuals); return manuals; } catch (error) { console.error("Error listing platform content manuals:", error); throw error; } } ``` -------------------------------- ### Partner User Client Initialization in ChatbotKit Node SDK Source: https://context7_llms Shows the initialization of the PartnerUserClient, which is used for managing partner users within the ChatbotKit platform. This client requires an instance of PartnerClient. ```typescript import { PartnerClient } from "@chatbotkit/sdk/partner/classes/PartnerClient"; import { PartnerUserClient } from "@chatbotkit/sdk/partner/user/classes/PartnerUserClient"; // Assume PartnerClient is already initialized const apiKey = "YOUR_API_KEY"; const partnerClient = new PartnerClient({ apiKey }); const partnerUserClient = new PartnerUserClient(partnerClient); console.log("PartnerUserClient initialized successfully."); // Use partnerUserClient for operations related to partner users. ``` -------------------------------- ### Platform Ability Client Initialization in ChatbotKit Node SDK Source: https://context7_llms Shows the initialization of the PlatformAbilityClient for managing platform abilities. This client requires an instance of PlatformClient to operate. ```typescript import { PlatformClient } from "@chatbotkit/sdk/platform/classes/PlatformClient"; import { PlatformAbilityClient } from "@chatbotkit/sdk/platform/ability/classes/PlatformAbilityClient"; // Assume PlatformClient is already initialized const apiKey = "YOUR_API_KEY"; const platformClient = new PlatformClient({ apiKey }); const platformAbilityClient = new PlatformAbilityClient(platformClient); console.log("PlatformAbilityClient initialized successfully."); // This client can be used to interact with platform abilities. ``` -------------------------------- ### Create a Blueprint (TypeScript) Source: https://context7_llms This snippet shows how to create a new blueprint using the BlueprintClient. It requires an existing client instance and blueprint details. The function returns the created blueprint object. ```typescript import { BlueprintClient } from "@chatbotkit/sdk/blueprint"; // Assuming 'client' is an initialized ChatBotKitClient instance const blueprintClient = new BlueprintClient(client); async function createMyBlueprint() { const blueprint = await blueprintClient.v1.createBlueprint({ name: "My Awesome Blueprint", description: "A blueprint for a new chatbot feature." }); console.log("Blueprint created:", blueprint); } ``` -------------------------------- ### CLI Solution Resource Management Source: https://context7_llms This module, @chatbotkit/cli/solution, deals with managing various resources for chatbot solutions. It includes classes like 'BotResource', 'DatasetResource', and 'Solution' along with configuration schemas for defining and configuring these resources. ```typescript import { Solution } from '@chatbotkit/cli/solution/classes/Solution'; import { BotResourceConfigSchema } from '@chatbotkit/cli/solution/variables/BotResourceConfigSchema'; // Example usage (conceptual): // const mySolution = new Solution(); // const botConfig = { name: 'MyBot', ... }; // if (BotResourceConfigSchema.parse(botConfig)) { // mySolution.addBot(botConfig); // } ``` -------------------------------- ### Fetch Usage Data with ChatbotKit SDK (JavaScript) Source: https://context7_llms Demonstrates how to use the `fetchUsage` function from the ChatbotKit SDK to retrieve usage statistics. This function requires an initialized client and returns usage data upon successful execution. No specific input parameters are shown, but it's assumed the client is configured. ```javascript import { ChatbotKit } from "@chatbotkit/sdk"; const client = new ChatbotKit({ apiKey: "YOUR_API_KEY", }); async function main() { const usage = await client.usage.fetchUsage(); console.log(usage); } main(); ``` -------------------------------- ### Platform Client Initialization in ChatbotKit Node SDK Source: https://context7_llms Demonstrates how to initialize the PlatformClient for interacting with platform-level features in the ChatbotKit SDK. This client serves as a base for accessing various platform functionalities. ```typescript import { PlatformClient } from "@chatbotkit/sdk/platform/classes/PlatformClient"; // Assuming you have an API key and other necessary configurations const apiKey = "YOUR_API_KEY"; const platformClient = new PlatformClient({ apiKey }); console.log("PlatformClient initialized successfully."); // Use platformClient to access sub-clients like PlatformAbilityClient, PlatformActionClient, etc. ``` -------------------------------- ### Manage Datasets using ChatbotKit SDK Source: https://context7_llms Provides client for interacting with datasets, including creating, fetching, updating, and deleting datasets. Requires initializing the DatasetClient. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ // ... }); // Example: Fetching a dataset async function fetchDatasetExample() { const datasetId = "your-dataset-id"; const dataset = await kit.dataset.fetchDataset(datasetId); console.log(dataset); } ``` -------------------------------- ### List MCP Server Integrations using ChatbotKit Node SDK Source: https://context7_llms This function lists all available MCP Server integrations. It requires the ChatbotKit client. The output is an array of integration objects. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function listMcpServerIntegrations() { const response = await kit.mcpserver.v1.list(); console.log(response); } ``` -------------------------------- ### List Platform Content Documents in ChatbotKit Node SDK Source: https://context7_llms Fetches a list of all documentation content items available on the platform. Optional parameters can be used for filtering or pagination. ```typescript import { listPlatformContentDocs, type ListPlatformContentDocsCommandInput } from "@chatbotkit/sdk/platform/content/doc/v1/functions/listPlatformContentDocs"; async function handleListPlatformContentDocs(params?: ListPlatformContentDocsCommandInput) { try { const docs = await listPlatformContentDocs(params); console.log("List of platform content documents:", docs); return docs; } catch (error) { console.error("Error listing platform content documents:", error); throw error; } } ``` -------------------------------- ### Search Platform Content Manuals in ChatbotKit Node SDK Source: https://context7_llms Allows searching through manual content on the platform based on provided query parameters. Returns manuals that match the search criteria. ```typescript import { searchPlatformContentManuals, type SearchPlatformContentManualsCommandInput } from "@chatbotkit/sdk/platform/content/manual/v1/functions/searchPlatformContentManuals"; async function handleSearchPlatformContentManuals(params: SearchPlatformContentManualsCommandInput) { try { const results = await searchPlatformContentManuals(params); console.log("Search results for platform content manuals:", results); return results; } catch (error) { console.error("Error searching platform content manuals:", error); throw error; } } ``` -------------------------------- ### Create a Contact using ChatbotKit SDK Source: https://context7_llms This function creates a new contact. It requires contact details as input and returns the created contact object. Ensure the SDK is properly initialized before use. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ // ... }); async function createContactExample() { const contact = await kit.contact.v1.createContact({ // contact details }); console.log(contact); } ``` -------------------------------- ### File Management (Node.js) Source: https://context7_llms Client for managing files in ChatBotKit. Supports creating, uploading, downloading, fetching, updating, deleting, listing, and synchronizing files. Requires an authenticated client instance. ```typescript import { FileClient } from "@chatbotkit/sdk/file"; import * as fs from 'fs'; // Assuming 'client' is an authenticated ChatBotKit SDK client const fileClient = new FileClient(client); // Example: Upload a file const fileStream = fs.createReadStream('path/to/your/file.txt'); const uploadResult = await fileClient.v1.uploadFile({ file: fileStream, name: "my-uploaded-file.txt" }); console.log(uploadResult); // Example: Download a file const downloadResult = await fileClient.v1.downloadFile("file-id"); // You can pipe downloadResult to a write stream to save the file console.log("File downloaded successfully."); // Example: List all files const files = await fileClient.v1.listFiles(); console.log(files); // Example: Fetch a file const file = await fileClient.v1.fetchFile("file-id"); console.log(file); ``` -------------------------------- ### Create MCP Server Integration using ChatbotKit Node SDK Source: https://context7_llms This function creates a new MCP Server integration. It requires the ChatbotKit client and integration details as input. The output is the created integration object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function createMcpServerIntegration() { const response = await kit.mcpserver.v1.create({ // integration details }); console.log(response); } ``` -------------------------------- ### List Messenger Integrations using ChatbotKit Node SDK Source: https://context7_llms This function lists all available Messenger integrations. It requires the ChatbotKit client. The output is an array of integration objects. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function listMessengerIntegrations() { const response = await kit.messenger.v1.list(); console.log(response); } ``` -------------------------------- ### List Notion Integrations using ChatbotKit Node SDK Source: https://context7_llms This function lists all available Notion integrations. It requires the ChatbotKit client. The output is an array of integration objects. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function listNotionIntegrations() { const response = await kit.notion.v1.list(); console.log(response); } ``` -------------------------------- ### Fetch Platform Content Manual in ChatbotKit Node SDK Source: https://context7_llms Retrieves a specific manual content item from the platform. This function requires the manual's ID. ```typescript import { fetchPlatformContentManual, type FetchPlatformContentManualCommandInput } from "@chatbotkit/sdk/platform/content/manual/v1/functions/fetchPlatformContentManual"; async function handleFetchPlatformContentManual(params: FetchPlatformContentManualCommandInput) { try { const manual = await fetchPlatformContentManual(params); console.log("Fetched platform content manual:", manual); return manual; } catch (error) { console.error("Error fetching platform content manual:", error); throw error; } } ``` -------------------------------- ### Task Management API Source: https://context7_llms APIs for managing tasks, including listing tasks. ```APIDOC ## GET /api/v1/tasks ### Description Lists all tasks. ### Method GET ### Endpoint /api/v1/tasks ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of tasks to return. - **offset** (integer) - Optional - The number of tasks to skip. ### Response #### Success Response (200) - **tasks** (array) - An array of task objects. - **id** (string) - The unique identifier of the task. - **title** (string) - The title of the task. - **description** (string) - The description of the task. #### Response Example ```json { "tasks": [ { "id": "task_abc", "title": "Follow up with client", "description": "Send follow-up email regarding the proposal." }, { "id": "task_def", "title": "Schedule meeting", "description": "Coordinate a meeting with the project team." } ] } ``` ``` -------------------------------- ### Dataset File Management (Node.js) Source: https://context7_llms Client for managing dataset files within ChatBotKit. Allows attaching, detaching, listing, and synchronizing files with datasets. Requires an authenticated client instance. ```typescript import { DatasetFileClient } from "@chatbotkit/sdk/dataset/file"; // Assuming 'client' is an authenticated ChatBotKit SDK client const datasetFileClient = new DatasetFileClient(client); // Example: Attach a file to a dataset const attachResult = await datasetFileClient.v1.attachDatasetFile({ datasetId: "your-dataset-id", fileId: "your-file-id" }); console.log(attachResult); // Example: List files for a dataset const files = await datasetFileClient.v1.listDatasetFiles("your-dataset-id"); console.log(files); // Example: Synchronize a dataset file const syncResult = await datasetFileClient.v1.syncDatasetFile({ datasetId: "your-dataset-id", fileId: "your-file-id" }); console.log(syncResult); ``` -------------------------------- ### Dataset API Source: https://context7_llms APIs for managing datasets. ```APIDOC ## Dataset Management API ### Description This API provides endpoints for managing datasets, which can be used to store and retrieve data for your chatbot. ### Endpoints - **GET /api/v1/datasets**: List all available datasets. - **POST /api/v1/datasets**: Create a new dataset. - **GET /api/v1/datasets/{datasetId}**: Fetch a specific dataset by its ID. - **PUT /api/v1/datasets/{datasetId}**: Update an existing dataset. - **DELETE /api/v1/datasets/{datasetId}**: Delete a dataset by its ID. ### Parameters #### Common Parameters - **datasetId** (string) - Required - The unique identifier for a dataset. #### Query Parameters (for GET /api/v1/datasets) - **limit** (integer) - Optional - The maximum number of datasets to return. - **offset** (integer) - Optional - The number of datasets to skip. #### Request Body (for POST /api/v1/datasets and PUT /api/v1/datasets/{datasetId}) - **name** (string) - Required - The name of the dataset. - **description** (string) - Optional - A description for the dataset. ### Example Usage #### Creating a dataset ```bash curl -X POST \ https://api.chatbotkit.com/v1/datasets \ -H 'Content-Type: application/json' \ -d '{ "name": "Product FAQs", "description": "Frequently asked questions about our products" }' ``` #### Listing datasets ```bash curl -X GET https://api.chatbotkit.com/v1/datasets?limit=10 ``` #### Fetching a dataset ```bash curl -X GET https://api.chatbotkit.com/v1/datasets/dataset_abc123 ``` ``` -------------------------------- ### Dataset Management (Node.js) Source: https://context7_llms Client for managing datasets in ChatBotKit. Enables creating, fetching, updating, deleting, listing, and searching datasets. Requires an authenticated client instance. ```typescript import { DatasetClient } from "@chatbotkit/sdk/dataset"; // Assuming 'client' is an authenticated ChatBotKit SDK client const datasetClient = new DatasetClient(client); // Example: Create a new dataset const createResult = await datasetClient.v1.createDataset({ name: "My New Dataset" }); console.log(createResult); // Example: Fetch a specific dataset const dataset = await datasetClient.v1.fetchDataset("dataset-id"); console.log(dataset); // Example: List all datasets const datasets = await datasetClient.v1.listDatasets(); console.log(datasets); // Example: Search datasets const searchResults = await datasetClient.v1.searchDataset({ query: "search term" }); console.log(searchResults); ``` -------------------------------- ### CLI Input Handling Source: https://context7_llms The @chatbotkit/cli/input module offers utilities for gathering user input in command-line interfaces. Functions like 'confirm' and 'prompt' facilitate interactive user experiences, essential for CLI tools. ```typescript import { confirm, prompt } from '@chatbotkit/cli/input/functions'; // Example usage: // const userConfirmed = await confirm('Are you sure?'); // const userName = await prompt('Enter your name:'); ``` -------------------------------- ### List Email Integrations using ChatbotKit Node SDK Source: https://context7_llms This function lists all available email integrations. It requires the ChatbotKit client. The output is an array of integration objects. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function listEmailIntegrations() { const response = await kit.email.v1.list(); console.log(response); } ``` -------------------------------- ### Discord Integration Management (Node.js) Source: https://context7_llms Client for managing Discord integrations within ChatBotKit. Enables creating, fetching, deleting, listing, and setting up Discord integrations. Requires an authenticated client instance. ```typescript import { DiscordIntegrationClient } from "@chatbotkit/sdk/integration/discord"; // Assuming 'client' is an authenticated ChatBotKit SDK client const discordIntegrationClient = new DiscordIntegrationClient(client); // Example: Create a Discord integration const createResult = await discordIntegrationClient.v1.createDiscordIntegration({ name: "My Discord Bot", guildId: "your-guild-id", channelId: "your-channel-id" }); console.log(createResult); // Example: Fetch a specific Discord integration const integration = await discordIntegrationClient.v1.fetchDiscordIntegration("integration-id"); console.log(integration); // Example: List all Discord integrations const integrations = await discordIntegrationClient.v1.listDiscordIntegrations(); console.log(integrations); // Example: Setup Discord integration (e.g., sync commands) const setupResult = await discordIntegrationClient.v1.setupDiscordIntegration("integration-id"); console.log(setupResult); ``` -------------------------------- ### Create Messenger Integration using ChatbotKit Node SDK Source: https://context7_llms This function creates a new Messenger integration. It requires the ChatbotKit client and integration details as input. The output is the created integration object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function createMessengerIntegration() { const response = await kit.messenger.v1.create({ // integration details }); console.log(response); } ``` -------------------------------- ### List Extract Integrations using ChatbotKit Node SDK Source: https://context7_llms This function lists all available extract integrations. It requires the ChatbotKit client. The output is an array of integration objects. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function listExtractIntegrations() { const response = await kit.extract.v1.list(); console.log(response); } ``` -------------------------------- ### Create Discord Integration using ChatbotKit Node SDK Source: https://context7_llms This function creates a new Discord integration. It requires the ChatbotKit client and integration details as input. The output is the created integration object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function createDiscordIntegration() { const response = await kit.discord.v1.create({ // integration details }); console.log(response); } ``` -------------------------------- ### Create Notion Integration using ChatbotKit Node SDK Source: https://context7_llms This function creates a new Notion integration. It requires the ChatbotKit client and integration details as input. The output is the created integration object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function createNotionIntegration() { const response = await kit.notion.v1.create({ // integration details }); console.log(response); } ``` -------------------------------- ### Search Platform Content Documents in ChatbotKit Node SDK Source: https://context7_llms Allows searching through documentation content on the platform based on provided query parameters. Returns documents that match the search criteria. ```typescript import { searchPlatformContentDocs, type SearchPlatformContentDocsCommandInput } from "@chatbotkit/sdk/platform/content/doc/v1/functions/searchPlatformContentDocs"; async function handleSearchPlatformContentDocs(params: SearchPlatformContentDocsCommandInput) { try { const results = await searchPlatformContentDocs(params); console.log("Search results for platform content documents:", results); return results; } catch (error) { console.error("Error searching platform content documents:", error); throw error; } } ``` -------------------------------- ### Create Email Integration using ChatbotKit Node SDK Source: https://context7_llms This function creates a new email integration. It requires the ChatbotKit client and integration details as input. The output is the created integration object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function createEmailIntegration() { const response = await kit.email.v1.create({ // integration details }); console.log(response); } ``` -------------------------------- ### Create Extract Integration using ChatbotKit Node SDK Source: https://context7_llms This function creates a new extract integration. It requires the ChatbotKit client and integration details as input. The output is the created integration object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function createExtractIntegration() { const response = await kit.extract.v1.create({ // integration details }); console.log(response); } ``` -------------------------------- ### Create a Task using ChatbotKit SDK Source: https://context7_llms This function creates a new task. It requires task details, potentially linked to a conversation or contact. Returns the created task object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ // ... }); async function createTaskExample() { const task = await kit.task.v1.createTask({ // task details }); console.log(task); } ``` -------------------------------- ### List Platform Abilities in ChatbotKit Node SDK Source: https://context7_llms This function retrieves a list of all available abilities on the ChatbotKit platform. It might accept parameters for filtering or pagination. ```typescript import { listPlatformAbilities, type ListPlatformAbilitiesCommandInput } from "@chatbotkit/sdk/platform/ability/v1/functions/listPlatformAbilities"; async function handleListPlatformAbilities(params?: ListPlatformAbilitiesCommandInput) { try { const abilities = await listPlatformAbilities(params); console.log("List of platform abilities:", abilities); return abilities; } catch (error) { console.error("Error listing platform abilities:", error); throw error; } } ``` -------------------------------- ### Dataset Record Management (Node.js) Source: https://context7_llms Client for managing records within ChatBotKit datasets. Supports creating, fetching, updating, deleting, listing, and exporting dataset records. Requires an authenticated client instance. ```typescript import { DatasetRecordClient } from "@chatbotkit/sdk/dataset/record"; // Assuming 'client' is an authenticated ChatBotKit SDK client const datasetRecordClient = new DatasetRecordClient(client); // Example: Create a new record in a dataset const createResult = await datasetRecordClient.v1.createDatasetRecord({ datasetId: "your-dataset-id", record: { text: "New record text", response: "Bot response" } }); console.log(createResult); // Example: Fetch a specific record const record = await datasetRecordClient.v1.fetchDatasetRecord("your-dataset-id", "record-id"); console.log(record); // Example: List all records for a dataset const records = await datasetRecordClient.v1.listDatasetRecords("your-dataset-id"); console.log(records); // Example: Export dataset records const exportResult = await datasetRecordClient.v1.exportDatasetRecords("your-dataset-id"); console.log(exportResult); ``` -------------------------------- ### Fetch MCP Server Integration using ChatbotKit Node SDK Source: https://context7_llms This function fetches a specific MCP Server integration by its ID. It requires the ChatbotKit client and the integration ID. The output is the fetched integration object. ```typescript import { ChatbotKit } from "@chatbotkit/sdk"; const kit = new ChatbotKit({ apiKey: "YOUR_API_KEY" }); async function fetchMcpServerIntegration(integrationId: string) { const response = await kit.mcpserver.v1.fetch(integrationId); console.log(response); } ``` -------------------------------- ### List Spaces (TypeScript) Source: https://context7_llms Fetches a list of available spaces. Spaces can represent different environments or tenants within an application. This function is useful for organization and multi-tenancy management. Returns an array of space objects. ```typescript import { SpaceClient } from "@chatbotkit/sdk/contact/space"; // Assuming 'client' is an initialized ChatBotKitClient instance const spaceClient = new SpaceClient(client); async function listAllSpaces() { const spaces = await spaceClient.v1.listSpaces(); console.log("Spaces:", spaces); } ``` -------------------------------- ### Create Partner User in ChatbotKit Node SDK Source: https://context7_llms This function is used to create a new partner user within the ChatbotKit platform. It requires the necessary details for the new user, such as name and contact information. ```typescript import { createPartnerUser, type CreatePartnerUserCommandInput } from "@chatbotkit/sdk/partner/user/v1/functions/createPartnerUser"; async function handleCreatePartnerUser(params: CreatePartnerUserCommandInput) { try { const newUser = await createPartnerUser(params); console.log("Partner user created:", newUser); return newUser; } catch (error) { console.error("Error creating partner user:", error); throw error; } } ```