dopplerjs
v1.2.5
Published
Revenue Reactivation Engine SDK — lightweight, zero heavy deps
Readme
Doppler SDK
The lightweight, zero-dependency revenue reactivation engine.
Doppler monitors user activity and automatically triggers AI-personalized recovery flows when users go dormant. Don't let your hard-earned users drift away.
Features
- Zero Dependencies: Ultra-lightweight (~15KB).
- Automated Lifecycle: Milestones for onboarding, project creation, and core actions.
- Heartbeat Tracking: Automatic activity monitoring every 5 minutes.
- AI Persona: Powers personalized recovery emails generated by Llama.
- ROI Tracking: Deterministic tracking of recovered revenue.
Installation
npm install dopplerjsQuick Start
1. Initialize
Initialize the SDK once, typically in your root App or index file.
import { doppler } from 'dopplerjs';
doppler.init({
clientKey: 'pk_client_your_key', // Found in Doppler dashboard
});2. Identify Users
Call identify when a user logs in or signs up. This metadata feeds the AI engine to personalize recovery emails.
doppler.identify('[email protected]', {
name: 'Jane Smith',
plan: 'pro',
planDaysLeft: 14 // Required for the "Trial Ending" flow
});3. Track Lifecycle Checkpoints (Essential)
Doppler uses a state machine to track user progress. Use these methods to feed the engine.
doppler.authStarted(); // Stage 1: User opened login/signup
doppler.authSuccess(); // Stage 2: User successfully authenticated
doppler.onboardingStarted(); // Stage 3: User started onboarding
doppler.onboardingCompleted(); // Stage 4: User finished onboarding
doppler.projectCreated(); // Stage 5: User created their first asset
doppler.coreAction(); // Stage 6: The "AHA" moment (Primary Value)
doppler.coreActionRepeat(); // Stage 7: Value confirmed (Repeat usage)You can also send custom checkpoints using:
doppler.checkpoint('custom_stage_name');4. Custom Tracking & Revenue
Track any custom event or revenue gained.
doppler.track('Created Invoice');
doppler.trackRevenue(29.00, 'Monthly Pro Upgrade');Advanced
Churn Feedback
Capture feedback when a user unsubscribes or churns.
doppler.captureChurnFeedback('too_expensive', 'Switching to a competitor');Available reasons: too_expensive, too_complex, found_alternative, not_needed, other.
Test Mode
Enable test mode to send all recovery emails to your founder account instead of real users.
doppler.init({
clientKey: 'pk_client_xxx',
testMode: true
});API Reference
| Method | Description |
|--------|-------------|
| init(options) | Required. Initializes the SDK. |
| identify(email, options) | Connects an email to the session. |
| track(event, props) | Track custom behavioral events. |
| trackRevenue(amount, label) | Record revenue events for ROI. |
| onboardingStarted() | Milestone: User started onboarding. |
| onboardingCompleted() | Milestone: User finished onboarding. |
| projectCreated() | Milestone: User created their first project/asset. |
| coreAction() | Milestone: User performed the primary value action. |
| reset() | Clears the current user session (Log out). |
License
MIT
