Terminology
This document defines the terminology for Claspo Plugin SDK documentation.
Terminology
This document defines the terminology for Claspo Plugin SDK documentation.
Core Concepts
Widget
Interactive UI element displayed on end-user websites. Widgets collect data, show promotions, gather feedback, or display information.
Appearance
Visual state of a widget for a specific viewport (desktop or mobile). Each widget can have multiple appearances.
Appearance Model
JSON object representing the complete visual configuration of a widget. Output of the Claspo Editor, input for Widget Display SDK. Also referred to as Document Model.
View
A page or step within a widget. Widgets can contain multiple views for multi-step flows (e.g., form → thank you page).
SDKs and Packages
Claspo Editor
Drag-and-drop widget editor hosted on Claspo CDN. Does not require technical expertise. Outputs JSON Appearance Model.
- Does not allow custom HTML/CSS editing
- Builds reusable components instead
- Fully customizable widget layout, structure, and appearance
- Accessed via
window['ClaspoEditor'].init(config)
Widget Display SDK
JavaScript SDK that renders widgets on end-user websites. Consumes Appearance Model and widget configuration, displays widgets, and emits user interaction events.
- Main entry:
STATIC_RESOURCES_URL/script.esm.js - Provides
WidgetAPIclass - Manages widget display state
- Emits events: visibility, click, data submit, widget close
Component SDK
Bridge between Claspo Editor and Components. Transforms user choices into code parameters, manages widget data, handles inter-component interaction, and processes dynamic data.
Display Rules SDK
UI components that configure targeting rules stored as JSON. Widget Display SDK consumes these rules to determine when and where to display widgets to end users.
Editor Extensions
SDK for customizing editor panels and UI elements.
NPM Packages
@claspo/common
Shared TypeScript types and utilities used across all Claspo packages.
@claspo/editor
Editor SDK providing TypeScript types for widget integration, including LayoutType, WidgetType, and configuration interfaces.
@claspo/renderer
Core Web Components rendering engine. Provides:
- Base classes:
WcElement,WcControlledElement - Action system
- Form management
- Services
- View routing
@claspo/document-connector
SDK connection layer for managing widget layouts, positioning, events, and resource loading in host documents.
Components
Component
JavaScript class extending browser-native WebComponent (via WcElement base class). Renders UI elements within widgets.
Manifest
Component configuration object defining:
- Props (properties)
- Styles
- Events
- i18n (internationalization keys)
WcElement
Base class from @claspo/renderer that all components extend. Provides lifecycle methods, state management, and event handling.
Widget Layout
Types of widget display formats:
| Layout Type | Constant | Description |
|---|---|---|
| Popup | DETACHED | Modal overlay centered on screen |
| Built-in | BUILT_IN | Embedded within page content at specified placement |
| Floating Box | FLOATING_BOX | Fixed-position box at screen corner |
| Floating Bar | FLOATING_BAR | Fixed-position bar at top or bottom of viewport |
| Launcher | LAUNCHER | Trigger button that opens another widget |
| Content Locker | CONTENT_LOCKER | Overlay blocking content until action completed |
Widget Types
Functional categories of widgets:
| Widget Type | Constant | Description |
|---|---|---|
| Subscription Form | SUBSCRIPTION_FORM | Email/contact collection |
| Informer | INFORMER | Information display only |
| Request Form | REQUEST_FORM | General data collection |
| Launcher | LAUNCHER | Trigger for other widgets |
| Age Verify | AGE_VERIFY | Age verification gate |
| Teaser | TEASER | Preview/teaser content |
Placements
Configuration for built-in widget insertion:
{
selector: '#widget', // CSS selector
insertType: 'AFTER_BEGIN' // BEFORE_BEGIN | AFTER_BEGIN | BEFORE_END | AFTER_END | REPLACE
}Configuration
Static Resources
Self-hosted bundle files required for widget display on end-user websites. Contents of site-scripts/bundle.zip must be hosted from the same domain as the customer's script.
Editor Init Config
Configuration object passed to ClaspoEditor.init() including:
authToken- Authentication tokencontainerElement- HTML element for editoreditorScriptsUrl- Claspo CDN URLstaticResourcesUrl- Customer-hosted resources URLapi- HTTP API handlerstheme- Visual customization
Theming
Editor visual customization system allowing brand colors, fonts, and UI element styling.
Contact Fields
Form field mapping configuration connecting widget inputs to customer data fields.
Multilanguage
Widget localization system:
- Editor: Configures widgets for multiple languages, provides AI-powered translations
- Widget Display SDK: Detects end-user language, requests appropriate localization
Prize Pool Manager
Gamification configuration system:
- Editor: Configures promocodes, prizes, winning probabilities
- Widget Display SDK: Fetches and distributes prizes to users
Actions
User interaction handlers within widgets:
| Action | Constant | Description |
|---|---|---|
| Subscribe Contact | SUBSCRIBE_CONTACT | Submit form data |
| Go to View | GO_TO_VIEW | Navigate to specific view |
| Go to Previous | GO_TO_PREVIOUS_VIEW | Navigate back |
| Go to Next | GO_TO_NEXT_VIEW | Navigate forward |
| Open Link | OPEN_LINK | Open URL |
| Close Widget | CLOSE_WIDGET | Close the widget |
| Show Widget | SHOW_WIDGET | Launch another widget |
| Dispatch Event | DISPATCH_EVENT | Fire custom event |
Events
Widget lifecycle events emitted by Widget Display SDK:
| Event | Constant | Description |
|---|---|---|
| Contact Data Submit | CONTACT_DATA_SUBMIT | Form submission |
| Close Widget | CLOSE_WIDGET | Widget closed |
| Show Widget | SHOW_WIDGET | Widget displayed |
| Close Icon Clicked | CLOSE_ICON_CLICKED | User clicked close button |
| Widget Content Clicked | WIDGET_CONTENT_CLICKED | User clicked widget content |
| Contact ID Received | CONTACT_ID_WAS_RECEIVED | Contact identified |
Integration Variables
| Variable | Description |
|---|---|
EDITOR_SCRIPTS_URL | Claspo CDN URL for editor scripts |
STATIC_RESOURCES_URL | Customer-hosted URL for widget resources |
API Classes
WidgetAPI
Main JavaScript class for managing website widgets:
import { WidgetAPI } from 'STATIC_RESOURCES_URL/script.esm.js';
const api = new WidgetAPI({ staticResourcesUrl: 'STATIC_RESOURCES_URL' });
api.showWidget(documentModel, widgetConfig);ClaspoEditor
Global editor instance:
window['ClaspoEditor'].init(config, successCallback, errorCallback);
window['ClaspoEditor'].destroy();
window['ClaspoEditor'].save();
window['ClaspoEditor'].cancel();Updated 1 day ago
