Overview
TheDeepdotsPopups class is the core interface for the MagicFeedback Popup SDK. It manages the lifecycle of survey popups, from initialization and trigger configuration to rendering and event handling.
Constructor
init() method before use.
Basic Usage Pattern
Server Mode (Recommended)
Fetches popup definitions from the Deepdots API at runtime:Client Mode
Uses preloaded popup definitions for local demos, testing, or hardcoded flows:Key Features
Multiple Trigger Types
Support for time-based, scroll-based, click-based, exit-intent, and custom event triggers
Event Lifecycle
Emit events for popup_shown, popup_clicked, and survey_completed
Route Targeting
Show popups only on specific paths using segments.path configuration
Flexible Rendering
Support for custom renderers via setRenderer() method
Architecture
TheDeepdotsPopups class maintains:
- Configuration state: API keys, mode, debug settings
- Popup definitions: Loaded from server or provided inline
- Trigger management: Automatically derived from popup definitions
- Event listeners: For popup lifecycle events
- Answer tracking: Prevents repeated displays based on conditions
- Deferred exit queue: Manages exit-intent popups across navigation
Next Steps
Methods
Explore all available methods and their signatures
Configuration
Learn about configuration options and interfaces
Related Resources
- Methods Reference - Complete method documentation
- Configuration Reference - All configuration options