Server mode is the recommended setup for production integrations. Popup definitions are managed remotely through the Deepdots API, allowing you to update surveys and targeting rules without deploying code changes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MagicFeedback/deepdots-popup-sdk/llms.txt
Use this file to discover all available pages before exploring further.
When to Use Server Mode
Use server mode when:- You want to manage popup definitions through the Deepdots dashboard
- You need to update surveys without redeploying your application
- You’re building a production integration
- You want centralized control over popup targeting and content
For local demos, QA environments, or integration testing without API calls, consider using client mode instead.
Installation
Configuration Options
Required Parameters
Must be set to
'server' to fetch popup definitions from the Deepdots API.Your public API key from the Deepdots dashboard. This identifies your project and determines which popups to load.
Optional Parameters
Determines which API environment to use:
'production'→https://api.deepdots.com'development'→https://api-dev.deepdots.com
Optional user identifier. Recommended when popups are targeted per user. The SDK will filter popups based on this ID.
Enables verbose logging to the console for debugging purposes.
Environment Setup
Production Environment
For production deployments, use the production API endpoint:Development Environment
For development and staging, use the development API endpoint:Listening to Events
Subscribe to SDK events to track popup activity in your application:Complete Example
Here’s a complete server mode setup with event tracking:How It Works
When you callinit() with mode: 'server', the SDK:
- Fetches popup definitions from the Deepdots API using your API key
- Filters by userId (if provided) to only load relevant popups
- Configures triggers automatically based on the fetched definitions
- Waits for definitions to load before starting triggers when you call
autoLaunch()
nodeEnv setting:
Next Steps
Event Triggers
Learn how to trigger popups from business events
Route Targeting
Target popups to specific pages and routes
Exit Popups
Show feedback popups when users navigate away
Client Mode
Use inline popup definitions for testing