Skip to content

Quickstart

The SDK runs in server mode: your popups, triggers, and targeting live in Deepdots and are fetched at runtime. You only need to mount the SDK, hand it your API key, and start it.

Terminal window
npm install @magicfeedback/popup-sdk
import { DeepdotsPopups } from '@magicfeedback/popup-sdk';
const popups = new DeepdotsPopups();
popups.init({
mode: 'server',
apiKey: 'YOUR_PUBLIC_API_KEY',
userId: 'customer-123', // optional — your internal user identifier
});
popups.autoLaunch();

That’s enough for popups to appear at the moments configured in Deepdots.

If you want to track popup interactions in your analytics, subscribe to the SDK events.

popups.on('popup_shown', (event) => analytics.track('popup_shown', event));
popups.on('survey_completed', (event) => analytics.track('survey_completed', event));

If any of your popups in Deepdots are configured with an event trigger, fire that event from your code whenever the business condition is met.

popups.triggerEvent('checkout_completed');

See Triggers for the full list of trigger types and code examples.

You should not need to define popup payloads in code. Popups, copy, triggers, cooldowns, and route targeting are all managed in Deepdots.