SDK API Reference
All SDK methods use the pattern DAP('methodName', ...args). Initialize the SDK before calling any other method.
Initialization and Teardown
DAP('init', config) -- Initialize the SDK. Call once on page load.
DAP("init", {
tenantKey: "YOUR_TENANT_KEY", // required
debug: false, // optional, enables console logging
autoTrack: true, // optional, auto-tracks page views, clicks, scroll depth
locale: "en", // optional, override detected locale
});
DAP('destroy') -- Tear down the SDK. Stops tracking, flushes events, removes overlays, and clears listeners.
User Identity
DAP('identify', payload) -- Associate the session with a known user. Re-fetches flows, content, and experiments for that user.
DAP("identify", {
userId: "user-42",
traits: { role: "admin", plan: "enterprise", signupDate: "2025-03-01" },
});
Event Tracking
DAP('track', eventName, properties) -- Send a custom analytics event with optional key-value properties.
DAP("track", "feature_activated", { featureName: "dark-mode", plan: "pro" });
Flows
DAP('startFlow', flowId) -- Start a guided flow by its ID.
DAP('stopFlow') -- Stop the currently running flow and remove its UI.
DAP("startFlow", "flow_abc123");
Content
DAP('showContent', contentId) -- Display a content item (tooltip, beacon, survey, announcement).
DAP('hideContent', contentId) -- Hide a content item.
DAP('refreshContent') -- Reload all content from the server after a state change. If contentRefreshInterval is configured, content is also refreshed automatically on a timer. Manual calls can still be used for immediate updates.
Journeys
DAP('startJourney', journeyId) -- Enroll the current user in a multi-step journey.
DAP('completeJourneyStep') -- Mark the current step as complete and advance.
Event Listeners
DAP('on', event, callback) -- Subscribe to an SDK lifecycle event. Can be called before init.
DAP('off', event, callback) -- Remove a listener. Pass the same function reference used with on.
const handler = (data) => console.log(data);
DAP("on", "flow:start", handler);
DAP("off", "flow:start", handler);
See SDK Events for the full list of available events and payloads.