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;
/**
* 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

productKey
string
Your product key from the Pillar app. Get it at app.trypillar.com
assistantDisplayName
string
Display name for the assistant shown in the sidebar tab.Defaults to 'Copilot'.
inputPlaceholder
string
Placeholder text shown in the chat input field.Defaults to 'Ask anything...'.
welcomeMessage
string
Welcome message shown in the home view.Defaults to 'Hi! How can I help you today?'.
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
Panel layout and behavior settings.
edgeTrigger
EdgeTriggerConfig
Edge trigger (sidebar tab that opens the panel).
mobileTrigger
MobileTriggerConfig
Mobile trigger (floating button on small screens).
urlParams
UrlParamsConfig
URL params for auto-opening the panel.
textSelection
TextSelectionConfig
Text selection "Ask AI" popover.
suggestions
SuggestionsConfig
Page-aware suggestions.
sidebarTabs
SidebarTabConfig[]
Sidebar tabs configuration.
apiBaseUrl
string
API base URL. Defaults to Pillar's production API.
tracing
boolean
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.
theme
ThemeConfig
Theme customization.
customCSS
string
Custom CSS to inject into the panel's Shadow DOM. Use public class names (pillar-*) to override default styles.
zIndex
ZIndexConfig
Z-index configuration for the SDK root container. Controls stacking order relative to host app content.
excludeRoutes
string[]
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

domScanning
DOMScanningConfig
DOM scanning for page context.

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

Position of the mobile floating trigger button.

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

MobileTriggerIcon

type

Preset icon for the mobile floating trigger button.

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

MobileTriggerSize

type

Size preset for the mobile floating trigger button.

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' | 'tools';
}

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' | 'tools'
Preset icon for this tab
Source: packages/sdk/src/core/config.ts