To use the WidgetSettings API, install the @wix/ai-site-chat
package using npm or Yarn:
or
Then import { widgetSettings }
from @wix/ai-site-chat
:
This article shares some possible use cases your app or site could support, as well as a sample flow that could support each use case. This can be a helpful jumping-off point.
To retrieve and update the widget settings:
To display a message if the AI assistant is offline:
assistantOnline
in the response.false
, display a message on the site.This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves the widget settings for the site.
function getWidgetSettings(): Promise<GetWidgetSettingsResponse>;
import { widgetSettings } from "@wix/ai-site-chat";
async function getWidgetSettings() {
const response = await widgetSettings.getWidgetSettings();
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.