Migrating from @inkeep/uikit-js to @inkeep/cxkit-js
This guide will help you migrate your JavaScript snippets from using @inkeep/uikit-js
to the new @inkeep/cxkit-js
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-js
to @inkeep/cxkit-js
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
Update your script tag to use the new package:
Breaking Changes
Component Initialization Changes
The way components are initialized has changed:
Configuration Structure Changes
The configuration structure has been simplified:
Base Settings Changes
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.
remoteErrorLogsLevel
The remoteErrorLogsLevel
property has been removed as error logging is now handled internally with improved defaults. If you need custom error handling, use the onError
callback.
consoleDebugLevel
The consoleDebugLevel
property has been removed as debugging is now handled internally with improved defaults. For development debugging, use the browser's developer tools.
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.
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
User Properties
User properties are now grouped under userProperties
:
Authentication Token
userToken
→ userAuthToken
Event Handling
logEventCallback
→ onEvent
(with updated event structure)
Privacy Preferences
Privacy preferences are now grouped:
API Endpoints
chatApiProxyDomain
→aiApiBaseUrl
analyticsApiProxyDomain
→analyticsApiBaseUrl
Environment Configuration
env
options are now lowercase: "development" | "production"
URL Parameters
appendQueryParamsToUrls
→ urlQueryParamsToAppend
Styling
stylesheets
and stylesheetUrls
→ styles
Color Mode Synchronization
The color mode synchronization has been updated:
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
Assistant Name and Avatar
-
botName
→aiAssistantName
-
botAvatarSrcUrl
→aiAssistantAvatar
-
botAvatarDarkSrcUrl
→ can be configured by changingaiAssistantAvatar
to an object:
User Avatar
userAvatarSrcUrl
→userAvatar
Example Questions
quickQuestions
→exampleQuestions
quickQuestionsLabel
→exampleQuestionsTitle
shouldHighlightFirstQuickQuestion
→isFirstExampleQuestionHighlighted
Disclaimer Settings
Disclaimer settings properties have been renamed:
Input Handling
handleMessageChange
→onInputMessageChange
Help Options
getHelpCallToActions
→getHelpOptions
Form Configuration
Form configuration has been updated with improved structuring. See Form Settings for details:
Sharing and Toolbar
isChatSharingEnabled
→isShareButtonVisible
shouldShowCopyChatButton
→isCopyChatButtonVisible
actionButtonLabels
→toolbarButtonLabels
Prompts
context
andguidance
→ useprompts
instead
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:
handleSearchQueryChange
The handleSearchQueryChange
property has been renamed to onQueryChange
for improved clarity:
tabSettings
The tabSettings
property has been renamed to tabs
for improved clarity and simplicity. See docs here for more details:
maximumHitsLimit
The maximumHitsLimit
property has been renamed to maxResults
for improved clarity:
debounceTime
The debounceTime
property has been renamed to debounceTimeMs
for improved clarity:
shouldShowAskAICard
The shouldShowAskAICard
property has been elevated to a top-level property:
Modal Settings Changes
Removed Properties
isShortcutKeyEnabled
The isShortcutKeyEnabled
property has been removed. To disable the shortcut key, pass shortcutKey
as null
, or pass a key to enable it:
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:
askAILabel
The askAILabel
property has been moved to be a top-level property:
switchToSearchMessage
The switchToSearchMessage
property has been renamed to searchLabel
and moved to be a top-level property:
isModeSwitchingEnabled
The isModeSwitchingEnabled
property has been renamed to canToggleView
and moved to be a top-level property:
forceInitialDefaultView
The forceInitialDefaultView
property has been renamed to forceDefaultView
and moved to be a top-level property:
Chat Button Changes
Removed Properties
chatButtonType
The chatButtonType
property has been removed as the button appearance can now be customized via CSS using the provided class names.
chatButtonBgColor
The chatButtonBgColor
property has been removed as the button background color can now be customized via CSS using the .ikp-chat-button__button
class.
chatButtonBgColorDarkMode
The chatButtonBgColorDarkMode
property has been removed as the button background color in dark mode can now be customized via CSS using the [data-theme='dark'] .ikp-chat-button__button
selector.
isPositionFixed
The isPositionFixed
property has been removed as the button positioning can now be customized via CSS by setting position: relative;
on the .ikp-chat-button__container
class.
fixedPositionXOffset
The fixedPositionXOffset
property has been removed as the button horizontal positioning can now be customized via CSS by setting right: 0;
on the .ikp-chat-button__container
class.
fixedPositionYOffset
The fixedPositionYOffset
property has been removed as the button vertical positioning can now be customized via CSS by setting bottom: 0;
on the .ikp-chat-button__container
class.
Renamed Properties
Button Label
chatButtonText
→label
Example Migration
Before (with @inkeep/uikit-js)
After (with @inkeep/cxkit-js)
API Keys
Production API keys for web integrations now require Enforce referrer URL
to be enabled for additional security. API keys without this setting will be severely rate limited. See Public API Keys for more details.
New Features
The new package includes several new features:
- Intelligent form component - See Form Settings
- Embedded search component - See Embedded Search
- Embedded search and chat component - See Embedded Search and Chat
Need Help?
If you encounter any issues during migration, please contact our support team for assistance.