About the Conversations API

The Conversations API enables you to retrieve conversation information for a site's AI Site-Chat.

With this API, you can:

  • Retrieve the conversation details for a site visitor.
  • Retrieve a site's total conversation stats, including the quota for the current plan.

Note: Wix AI Site-Chat is currently only available in the Wix Editor.

Before you begin

It's important to note the following point before starting to code:

Use cases

Did this help?

Setup

@wix/ai-site-chat

To use the Conversations API, install the @wix/ai-site-chat package.

Install the package

To install the package, follow the instructions below based on your development environment.

Wix sites and Blocks apps

When developing with:

Copy
npm install @wix/ai-site-chat

or

Copy
yarn add @wix/ai-site-chat

Wix apps and Headless

When developing CLI or self-hosted Wix apps, as well as headless apps or sites, run the following command:

Copy
npm install @wix/ai-site-chat

or

Copy
yarn add @wix/ai-site-chat

Import the package

To import the package in your code:

Copy
import { conversations } from "@wix/ai-site-chat";
Did this help?

Conversations: Sample Use Cases and Flows

This article shares a possible use case your app or site could support, as well as a sample flow. This can be a helpful jumping-off point.

Reduce the AI assistant's active hours if the quota has nearly been reached

To reduce the AI assistant's active hours if the quota has nearly been reached:

  1. Call Get Conversation Usage.
  2. In the response, if the value of current is greater than 80% of quota, call Set Widget Settings to reduce the AI assistant's active hours.
Did this help?