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;/*** Display name for the assistant shown in the sidebar tab.* @default 'Copilot'*/assistantDisplayName?: string;/*** Placeholder text shown in the chat input field.* @default 'Ask anything...'*/inputPlaceholder?: string;/*** Welcome message shown in the home view.* @default 'Hi! How can I help you today?'*/welcomeMessage?: 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 layout and behavior 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.* @internal DOM scanning is currently disabled.* @deprecated This feature is not available.*/domScanning?: DOMScanningConfig;/** Page-aware suggestions. */suggestions?: SuggestionsConfig;/** Sidebar tabs configuration. */sidebarTabs?: SidebarTabConfig[];/** API base URL. Defaults to Pillar's production API. */apiBaseUrl?: string;/*** Enable OpenTelemetry tracing. Browser spans are exported to the server's* Cloud Trace project via the OTLP proxy endpoint. Also enabled when debug* is true.* @default false*/tracing?: boolean;/** 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;/*** Z-index configuration for the SDK root container.* Controls stacking order relative to host app content.*/zIndex?: ZIndexConfig;/*** Route prefixes where the SDK UI is hidden.* When the current pathname matches any entry (exact match or starts with* the entry followed by `/`), the panel, edge trigger, mobile trigger,* and text selection popover are all hidden. UI is restored when the user* navigates to a non-excluded route.** Pass an empty array to show the SDK on every route.* @default ['/login', '/signup']* @example ['/login', '/signup', '/onboarding']*/excludeRoutes?: string[];/** Called when the SDK is initialized and ready. */onReady?: () => void;/** Called when the SDK encounters an error. */onError?: (error: Error) => void;}
Properties
Properties
productKeystring
Your product key from the Pillar app.
Get it at app.trypillar.com
assistantDisplayNamestring
Display name for the assistant shown in the sidebar tab.Defaults to
'Copilot'.inputPlaceholderstring
Placeholder text shown in the chat input field.Defaults to
'Ask anything...'.welcomeMessagestring
Welcome message shown in the home view.Defaults to
'Hi! How can I help you today?'.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
Panel layout and behavior settings.
edgeTriggerEdgeTriggerConfig
Edge trigger (sidebar tab that opens the panel).
mobileTriggerMobileTriggerConfig
Mobile trigger (floating button on small screens).
urlParamsUrlParamsConfig
URL params for auto-opening the panel.
textSelectionTextSelectionConfig
Text selection "Ask AI" popover.
suggestionsSuggestionsConfig
Page-aware suggestions.
sidebarTabsSidebarTabConfig[]
Sidebar tabs configuration.
apiBaseUrlstring
API base URL. Defaults to Pillar's production API.
tracingboolean
Enable OpenTelemetry tracing. Browser spans are exported to the server's
Cloud Trace project via the OTLP proxy endpoint. Also enabled when debug
is true.Defaults to
false.themeThemeConfig
Theme customization.
customCSSstring
Custom CSS to inject into the panel's Shadow DOM.
Use public class names (pillar-*) to override default styles.
zIndexZIndexConfig
Z-index configuration for the SDK root container.
Controls stacking order relative to host app content.
excludeRoutesstring[]
Route prefixes where the SDK UI is hidden.
When the current pathname matches any entry (exact match or starts with
the entry followed by `/`), the panel, edge trigger, mobile trigger,
and text selection popover are all hidden. UI is restored when the user
navigates to a non-excluded route.
Pass an empty array to show the SDK on every route.Defaults to
['/login', '/signup'].onReady() => void
Called when the SDK is initialized and ready.
onError(error: Error) => void
Called when the SDK encounters an error.
Deprecated
domScanningDOMScanningConfig
DOM scanning for page context.
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
typePosition of the mobile floating trigger button.
typescript
type MobileTriggerPosition = 'bottom-right' | 'bottom-left'
MobileTriggerIcon
typePreset icon for the mobile floating trigger button.
typescript
type MobileTriggerIcon = 'sparkle' | 'question' | 'help' | 'chat' | 'support'
MobileTriggerSize
typeSize preset for the mobile floating trigger button.
typescript
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' | 'tools';}
Properties
idrequiredstring
No description.
labelrequiredstring
No description.
enabledrequiredboolean
No description.
orderrequirednumber
No description.
icon'help' | 'support' | 'settings' | 'feedback' | 'chat' | 'calendar' | 'mail' | 'tools'
Preset icon for this tab
Source:
packages/sdk/src/core/config.ts