Search documentation

Search documentation

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 settings
panel?: 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 panel
urlParams?: UrlParamsConfig;
// Text selection "Ask AI" popover
textSelection?: TextSelectionConfig;
// DOM scanning for page context
domScanning?: DOMScanningConfig;
// Page-aware suggestions
suggestions?: SuggestionsConfig;
// Sidebar tabs configuration
sidebarTabs?: SidebarTabConfig[];
// API base URL (defaults to production)
apiBaseUrl?: string;
// Theme customization
theme?: 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;
// Callbacks
onReady?: () => void;
onError?: (error: Error) => void;
}

Properties

Properties

productKey
string
Your product key from the Pillar app. Get it at app.trypillar.com
platform
Platform
Platform identifier for code-first actions. Used to filter actions by deployment platform.Defaults to 'web'.
version
string
App version for code-first actions. Used to match actions to the correct deployment version.
debug
boolean
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.
panel
PanelConfig
No description.
edgeTrigger
EdgeTriggerConfig
No description.
mobileTrigger
MobileTriggerConfig
No description.
urlParams
UrlParamsConfig
No description.
textSelection
TextSelectionConfig
No description.
domScanning
DOMScanningConfig
No description.
suggestions
SuggestionsConfig
No description.
sidebarTabs
SidebarTabConfig[]
No description.
apiBaseUrl
string
No description.
theme
ThemeConfig
No description.
customCSS
string
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

interface
typescript
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

enabled
boolean
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.
resizable
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.Defaults to true.

MobileTriggerConfig

interface
typescript
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

enabled
boolean
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.
breakpoint
number
Viewport width below which the edge trigger hides and mobile trigger shows.Defaults to 700.
position
MobileTriggerPosition
Position of the floating button.Defaults to 'bottom-right'.
icon
MobileTriggerIcon
Preset icon to display in the button.Defaults to 'sparkle'.
customIcon
string
Custom SVG icon string. Overrides the icon preset if provided.
backgroundColor
string
Background color of the button (CSS value). Defaults to the theme's primary color.
iconColor
string
Icon color (CSS value).Defaults to 'white'.
size
MobileTriggerSize | number
Button size - preset name or pixel value. - 'small': 44px - 'medium': 56px (default) - 'large': 68pxDefaults to 'medium'.
label
string
Tooltip text and aria-label for accessibility.Defaults to 'Get help'.
offset
number
Offset from screen edges in pixels.Defaults to 24.

MobileTriggerPosition

type
typescript
type MobileTriggerPosition = 'bottom-right' | 'bottom-left'

MobileTriggerIcon

type
typescript
type MobileTriggerIcon = 'sparkle' | 'question' | 'help' | 'chat' | 'support'

MobileTriggerSize

type
typescript
type MobileTriggerSize = 'small' | 'medium' | 'large'

UrlParamsConfig

interface
typescript
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

enabled
boolean
Whether to check URL params for auto-opening the panel (default: true)
prefix
string
Prefix for URL params (default: 'pillar-')
clearAfterOpen
boolean
Whether to clear URL params after opening (default: true)

InteractionHighlightConfig

interface
typescript
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

enabled
boolean
Whether to highlight elements when the AI interacts with them.Defaults to true.
outlineColor
string
Outline color for highlighted elements (CSS color value).Defaults to '#3b82f6' (blue-500).
outlineWidth
number
Outline width in pixels.Defaults to 2.
outlineOffset
number
Outline offset in pixels (space between element and outline).Defaults to 2.
duration
number
Duration in milliseconds to show the highlight. Set to 0 for no auto-removal (highlight stays until next interaction).Defaults to 2000.
scrollIntoView
boolean
Whether to scroll the element into view if not visible.Defaults to true.
scrollBehavior
ScrollBehavior
Scroll behavior when scrolling element into view.Defaults to 'smooth'.

SuggestionsConfig

interface
typescript
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

enabled
boolean
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.
debounceMs
number
Debounce time for route change detection (ms). Prevents excessive sorting on rapid navigation.Defaults to 100.
displayLimit
number
Maximum number of suggestions to display.Defaults to 3.

SidebarTabConfig

interface

Sidebar 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

id
requiredstring
No description.
label
requiredstring
No description.
enabled
requiredboolean
No description.
order
requirednumber
No description.
icon
'help' | 'support' | 'settings' | 'feedback' | 'chat' | 'calendar' | 'mail'
Preset icon for this tab
Source: packages/sdk/src/core/config.ts