Migrating from @inkeep/uikit to @inkeep/cxkit-react
This guide will help you migrate your application from using @inkeep/uikit
to the new @inkeep/cxkit-react
package. The new package includes several breaking changes but offers improved functionality and a more consistent API.
Overview
With version 0.5.x, we've renamed our package from @inkeep/uikit
to @inkeep/cxkit-react
to better reflect its purpose as a customer experience toolkit. This change comes with several API improvements and breaking changes that require updates to your code.
Installation
First, you'll need to update your package dependency:
Breaking Changes
Package Import Changes
Update your imports from:
To:
Base Settings Changes
Several properties in the base settings have been removed or renamed:
Removed Properties
integrationId
The integrationId
property has been removed as it's no longer required for authentication. The API key now contains all the necessary information to identify your integration.
organizationId
The organizationId
property has been removed as it's no longer required for authentication. The API key now contains all the necessary information to identify your organization.
userType
The userType
property has been removed in favor of the more flexible userProperties.cohorts
array, which allows you to specify multiple user types or roles. See docs here for more details.
remoteErrorLogsLevel
The remoteErrorLogsLevel
property has been removed as error logging is now handled internally with improved defaults.
consoleDebugLevel
The consoleDebugLevel
property has been removed as debugging is now handled internally with improved defaults.
customCardSettings
The customCardSettings
property has been removed in favor of the more powerful and flexible transformSource
function, which allows for more comprehensive customization of search results and chat sources
See Source Transformation for more details.
breadcrumbRules
The breadcrumbRules
property has been removed in favor of the more powerful and flexible transformSource
function, which allows for more comprehensive customization of breadcrumbs.
See Source Transformation for more details.
stringReplacementRules
The stringReplacementRules
property has been removed in favor of the more powerful and flexible transformSource
function, which allows for more comprehensive string transformations.
See Source Transformation for more details.
Renamed Properties
userId
userEmail
userName
User properties are now grouped under userProperties
. See User Properties for more details.
userToken
The userToken
property has been renamed to userAuthToken
to better reflect its purpose as an authentication token for the user. See User Properties for more details:
logEventCallback
The logEventCallback
property has been renamed to onEvent
with an updated event structure for more consistent event handling. See Event Handling for more details:
chatApiProxyDomain
The chatApiProxyDomain
property has been renamed to aiApiBaseUrl
to better reflect its purpose as an API endpoint for AI chat functionality. See Event Handling for more details:
analyticsApiProxyDomain
The analyticsApiProxyDomain
property has been renamed to analyticsApiBaseUrl
to better reflect its purpose as an API endpoint for analytics functionality. See Core Settings for more details:
appendQueryParamsToUrls
The appendQueryParamsToUrls
property has been renamed to urlQueryParamsToAppend
for clarity. See URL Parameters for more details:
stylesheets
stylesheetUrls
Stylesheet properties have been consolidated under a single styles
property. Style strings can be passed directly. See Theme Configuration for more details:
Modified properties
env
env
options are now lowercase: "development" | "production"
AI Chat Settings Changes
Removed Properties
isControlledMessage
The isControlledMessage
property has been removed as the component now uses a more intuitive controlled/uncontrolled pattern. Use the defaultMessage
prop for uncontrolled behavior or the message
and onInputMessageChange
props for controlled behavior.
includeAIAnnotations
The includeAIAnnotations
property has been removed as annotations are now handled internally with improved defaults. Equivalent functionality will be available in a future release.
aiAnnotationPolicies
The aiAnnotationPolicies
property has been removed as annotation policies are now handled internally with improved defaults. Equivalent functionality will be available in a future release.
Renamed Properties
botName
botAvatarSrcUrl
botAvatarDarkSrcUrl
-
botName
→aiAssistantName
-
botAvatarSrcUrl
→aiAssistantAvatar
-
botAvatarDarkSrcUrl
→ can be configured by changingaiAssistantAvatar
to an object:
userAvatarSrcUrl
userAvatarSrcUrl
→userAvatar
quickQuestions
quickQuestions
is now exampleQuestions
for improved clarity:
exampleQuestionsLabel
exampleQuestionsLabel
is now exampleQuestionsTitle
for improved clarity:
shouldHighlightFirstQuickQuestion
shouldHighlightFirstQuickQuestion
is now isFirstExampleQuestionHighlighted
for improved clarity:
disclaimerSettings
isDisclaimerEnabled
is now isEnabled
and disclaimerLabel
is now label
and disclaimerTooltip
is now tooltip
within the AIChatDisclaimerSettings
type.
handleMessageChange
handleMessageChange
is now onInputMessageChange
for improved clarity:
getHelpCallToActions
getHelpCallToActions
is now getHelpOptions
for improved clarity:
FormConfig
type
FormConfig
type is now AIChatFormSettings
for improved clarity and the configuration has changed. See here for more details: AIChatFormSettings
isChatSharingEnabled
The isChatSharingEnabled
property has been renamed to isShareButtonVisible
for improved clarity:
shouldShowCopyChatButton
The shouldShowCopyChatButton
property has been renamed to isCopyChatButtonVisible
for improved clarity and consistency with other visibility properties:
actionButtonLabels
The actionButtonLabels
property has been renamed to toolbarButtonLabels
to better reflect its purpose for configuring toolbar button text:
context
guidance
The context
and guidance
properties have been consolidated under the more flexible prompts
property. The new prompts is an array of strings.
Search Settings Changes
Removed Properties
isControlledSearchQuery
The isControlledSearchQuery
property has been removed as the component now uses a more intuitive controlled/uncontrolled pattern. Use the defaultQuery
prop for uncontrolled behavior or the query
and onQueryChange
props for controlled behavior.
Renamed Properties
prefilledQuery
The prefilledQuery
property has been renamed to defaultQuery
for improved clarity and consistency with React patterns:
handleSearchQueryChange
The handleSearchQueryChange
property has been renamed to onQueryChange
for improved clarity and consistency with React event handler naming conventions:
tabSettings
The tabSettings
property has been renamed to tabs
for improved clarity and simplicity. tabs definitions have been updated as well. See docs here for more details.
shouldShowAskAICard
The shouldShowAskAICard
property has been elevated to a top-level property:
maximumHitsLimit
The maximumHitsLimit
property has been renamed to maxResults
for improved clarity and simplicity:
debounceTime
The debounceTime
property has been renamed to debounceTimeMs
for improved clarity on the unit of time:
Modal Settings Changes
Removed Properties
isShortcutKeyEnabled
The isShortcutKeyEnabled
property has been removed. To disable the shortcut key, pass shortcutKey
as null
.
isAlignedToTop
The isAlignedToTop
property has been removed as modal positioning is now handled through CSS.
isAlignedToRight
The isAlignedToRight
property has been removed as modal positioning is now handled through CSS.
onShortcutKeyPressed
The onShortcutKeyPressed
property has been removed as shortcut key handling is now managed internally.
Renamed Properties
openShortcutKey
The openShortcutKey
property has been renamed to shortcutKey
for improved clarity. It has a default value of k
:
askAILabel
The askAILabel
property has been moved to be a top-level prop:
switchToSearchMessage
The switchToSearchMessage
property has been renamed to searchLabel
and moved to be a top-level prop:
isModeSwitchingEnabled
The isModeSwitchingEnabled
property has been renamed to canToggleView
and moved to be a top-level prop:
forceInitialDefaultView
The forceInitialDefaultView
property has been renamed to forceDefaultView
and moved to be a top-level prop:
Chat Button Changes
Removed Properties
chatButtonType
The chatButtonType
property has been removed as button styling is now handled through CSS.
chatButtonBgColor
The chatButtonBgColor
property has been removed. You can change the background color via CSS using the .ikp-chat-button__button
class:
chatButtonBgColorDarkMode
The chatButtonBgColorDarkMode
property has been removed. You can change the background color for dark mode via CSS using the [data-theme='dark'] .ikp-chat-button__button
selector:
isPositionFixed
The isPositionFixed
property has been removed. You can change the positioning via CSS by setting position: relative;
on the .ikp-chat-button__container
class:
fixedPositionXOffset
The fixedPositionXOffset
property has been removed. You can change the horizontal positioning via CSS by setting right: 0;
on the .ikp-chat-button__container
class:
fixedPositionYOffset
The fixedPositionYOffset
property has been removed. You can change the vertical positioning via CSS by setting bottom: 0;
on the .ikp-chat-button__container
class:
Renamed Properties
chatButtonText
The chatButtonText
property has been renamed to label
for improved clarity and consistency:
Custom Trigger Changes
Renamed Component
The CustomTrigger
component has been renamed to provide more specific functionality:
ModalSearchAndChat
- For both search and chat functionalityModalSearch
- For just search functionalityModalChat
- For just chat functionality
See here for more details.
Moved Properties
isOpen
The isOpen
property has been moved inside modalSettings
:
onOpen
The onOpen
property has been renamed to onOpenChange
and moved inside modalSettings
:
onClose
The onClose
property has been removed. You can now utilize onOpenChange
(moved inside modalSettings
) to handle both open and close events:
API Keys
Production API keys for web integrations are now required to have Enforce referrer URL
enabled for additional security. See here for details. API keys without this setting will be severely rate limited.