Type@pillar-ai/sdk
PillarConfig
typescript
import type { PillarConfig } from '@pillar-ai/sdk'
Definition
typescript
interface PillarConfig {/*** Your product key from the Pillar app.* Get it at app.trypillar.com*/productKey?: string;/*** Platform identifier for code-first actions.* Used to filter actions by deployment platform.* @default 'web'*/platform?: Platform;/*** App version for code-first actions.* Used to match actions to the correct deployment version.* @example '1.2.3' or git commit SHA*/version?: string;/*** Enable debug mode for verbose logging and debug panel.* When enabled:* - All SDK events are logged to console* - A debug panel shows real-time execution flow* - Network requests/responses are captured* @default false*/debug?: boolean;// Panel settingspanel?: PanelConfig;// Edge trigger (sidebar tab that opens the panel)edgeTrigger?: EdgeTriggerConfig;// Mobile trigger (floating button on small screens)mobileTrigger?: MobileTriggerConfig;// URL params for auto-opening the panelurlParams?: UrlParamsConfig;// Text selection "Ask AI" popovertextSelection?: TextSelectionConfig;// DOM scanning for page contextdomScanning?: DOMScanningConfig;// Page-aware suggestionssuggestions?: SuggestionsConfig;// Sidebar tabs configurationsidebarTabs?: SidebarTabConfig[];// API base URL (defaults to production)apiBaseUrl?: string;// Theme customizationtheme?: ThemeConfig;/*** Custom CSS to inject into the panel's Shadow DOM.* Use public class names (pillar-*) to override default styles.* @example* ```css* .pillar-header { padding: 24px; }* .pillar-message-user { border-radius: 8px; }* ```*/customCSS?: string;// CallbacksonReady?: () => void;onError?: (error: Error) => void;}
Properties
Properties
productKeystring
Your product key from the Pillar app.
Get it at app.trypillar.com
platformPlatform
Platform identifier for code-first actions.
Used to filter actions by deployment platform.Defaults to
'web'.versionstring
App version for code-first actions.
Used to match actions to the correct deployment version.
debugboolean
Enable debug mode for verbose logging and debug panel.
When enabled:
- All SDK events are logged to console
- A debug panel shows real-time execution flow
- Network requests/responses are capturedDefaults to
false.panelPanelConfig
No description.
edgeTriggerEdgeTriggerConfig
No description.
mobileTriggerMobileTriggerConfig
No description.
urlParamsUrlParamsConfig
No description.
textSelectionTextSelectionConfig
No description.
domScanningDOMScanningConfig
No description.
suggestionsSuggestionsConfig
No description.
sidebarTabsSidebarTabConfig[]
No description.
apiBaseUrlstring
No description.
themeThemeConfig
No description.
customCSSstring
Custom CSS to inject into the panel's Shadow DOM.
Use public class names (pillar-*) to override default styles.
onReady() => void
No description.
onError(error: Error) => void
No description.
Related Types
Related Configuration Types
EdgeTriggerConfig
interfacetypescript
interface EdgeTriggerConfig {/*** Whether to show the edge trigger sidebar tab.* When enabled, a slim vertical tab appears on the screen edge that opens the panel.* @default true*/enabled?: boolean;/*** Whether the panel can be resized by dragging the edge of the sidebar trigger.* When enabled, a drag handle appears on the inner edge of the sidebar when the panel is open.* The resized width is persisted to localStorage.* @default true*/resizable?: boolean;}
Properties
enabledboolean
Whether to show the edge trigger sidebar tab.
When enabled, a slim vertical tab appears on the screen edge that opens the panel.Defaults to
true.resizableboolean
Whether the panel can be resized by dragging the edge of the sidebar trigger.
When enabled, a drag handle appears on the inner edge of the sidebar when the panel is open.
The resized width is persisted to localStorage.Defaults to
true.MobileTriggerConfig
interfacetypescript
interface MobileTriggerConfig {/*** Whether to show the mobile floating button on small screens.* When enabled, a floating action button appears when viewport is below mobileBreakpoint.* @default true*/enabled?: boolean;/*** Viewport width below which the edge trigger hides and mobile trigger shows.* @default 700*/breakpoint?: number;/*** Position of the floating button.* @default 'bottom-right'*/position?: MobileTriggerPosition;/*** Preset icon to display in the button.* @default 'sparkle'*/icon?: MobileTriggerIcon;/*** Custom SVG icon string. Overrides the icon preset if provided.*/customIcon?: string;/*** Background color of the button (CSS value).* Defaults to the theme's primary color.*/backgroundColor?: string;/*** Icon color (CSS value).* @default 'white'*/iconColor?: string;/*** Button size - preset name or pixel value.* - 'small': 44px* - 'medium': 56px (default)* - 'large': 68px* @default 'medium'*/size?: MobileTriggerSize | number;/*** Tooltip text and aria-label for accessibility.* @default 'Get help'*/label?: string;/*** Offset from screen edges in pixels.* @default 24*/offset?: number;}
Properties
enabledboolean
Whether to show the mobile floating button on small screens.
When enabled, a floating action button appears when viewport is below mobileBreakpoint.Defaults to
true.breakpointnumber
Viewport width below which the edge trigger hides and mobile trigger shows.Defaults to
700.positionMobileTriggerPosition
Position of the floating button.Defaults to
'bottom-right'.iconMobileTriggerIcon
Preset icon to display in the button.Defaults to
'sparkle'.customIconstring
Custom SVG icon string. Overrides the icon preset if provided.
backgroundColorstring
Background color of the button (CSS value).
Defaults to the theme's primary color.
iconColorstring
Icon color (CSS value).Defaults to
'white'.sizeMobileTriggerSize | number
Button size - preset name or pixel value.
- 'small': 44px
- 'medium': 56px (default)
- 'large': 68pxDefaults to
'medium'.labelstring
Tooltip text and aria-label for accessibility.Defaults to
'Get help'.offsetnumber
Offset from screen edges in pixels.Defaults to
24.MobileTriggerPosition
typetypescript
type MobileTriggerPosition = 'bottom-right' | 'bottom-left'
MobileTriggerIcon
typetypescript
type MobileTriggerIcon = 'sparkle' | 'question' | 'help' | 'chat' | 'support'
MobileTriggerSize
typetypescript
type MobileTriggerSize = 'small' | 'medium' | 'large'
UrlParamsConfig
interfacetypescript
interface UrlParamsConfig {/** Whether to check URL params for auto-opening the panel (default: true) */enabled?: boolean;/** Prefix for URL params (default: 'pillar-') */prefix?: string;/** Whether to clear URL params after opening (default: true) */clearAfterOpen?: boolean;}
Properties
enabledboolean
Whether to check URL params for auto-opening the panel (default: true)
prefixstring
Prefix for URL params (default: 'pillar-')
clearAfterOpenboolean
Whether to clear URL params after opening (default: true)
InteractionHighlightConfig
interfacetypescript
interface InteractionHighlightConfig {/*** Whether to highlight elements when the AI interacts with them.* @default true*/enabled?: boolean;/*** Outline color for highlighted elements (CSS color value).* @default '#3b82f6' (blue-500)*/outlineColor?: string;/*** Outline width in pixels.* @default 2*/outlineWidth?: number;/*** Outline offset in pixels (space between element and outline).* @default 2*/outlineOffset?: number;/*** Duration in milliseconds to show the highlight.* Set to 0 for no auto-removal (highlight stays until next interaction).* @default 2000*/duration?: number;/*** Whether to scroll the element into view if not visible.* @default true*/scrollIntoView?: boolean;/*** Scroll behavior when scrolling element into view.* @default 'smooth'*/scrollBehavior?: ScrollBehavior;}
Properties
enabledboolean
Whether to highlight elements when the AI interacts with them.Defaults to
true.outlineColorstring
Outline color for highlighted elements (CSS color value).Defaults to
'#3b82f6' (blue-500).outlineWidthnumber
Outline width in pixels.Defaults to
2.outlineOffsetnumber
Outline offset in pixels (space between element and outline).Defaults to
2.durationnumber
Duration in milliseconds to show the highlight.
Set to 0 for no auto-removal (highlight stays until next interaction).Defaults to
2000.scrollIntoViewboolean
Whether to scroll the element into view if not visible.Defaults to
true.scrollBehaviorScrollBehavior
Scroll behavior when scrolling element into view.Defaults to
'smooth'.SuggestionsConfig
interfacetypescript
interface SuggestionsConfig {/*** Enable page-aware suggestion sorting.* When enabled, suggestions are re-sorted based on the current page context* whenever the user navigates to a new route.* @default true*/enabled?: boolean;/*** Debounce time for route change detection (ms).* Prevents excessive sorting on rapid navigation.* @default 100*/debounceMs?: number;/*** Maximum number of suggestions to display.* @default 3*/displayLimit?: number;}
Properties
enabledboolean
Enable page-aware suggestion sorting.
When enabled, suggestions are re-sorted based on the current page context
whenever the user navigates to a new route.Defaults to
true.debounceMsnumber
Debounce time for route change detection (ms).
Prevents excessive sorting on rapid navigation.Defaults to
100.displayLimitnumber
Maximum number of suggestions to display.Defaults to
3.SidebarTabConfig
interfaceSidebar tab configuration
typescript
interface SidebarTabConfig {id: string;label: string;enabled: boolean;order: number;/** Preset icon for this tab */icon?: 'help' | 'support' | 'settings' | 'feedback' | 'chat' | 'calendar' | 'mail';}
Properties
idrequiredstring
No description.
labelrequiredstring
No description.
enabledrequiredboolean
No description.
orderrequirednumber
No description.
icon'help' | 'support' | 'settings' | 'feedback' | 'chat' | 'calendar' | 'mail'
Preset icon for this tab
Source:
packages/sdk/src/core/config.ts