rampkit-expo-dev 0.0.63 → 0.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,19 +76,7 @@ declare class EventManager {
76
76
  */
77
77
  trackOnboardingAbandoned(reason: string, lastScreenName?: string, onboardingId?: string): void;
78
78
  /**
79
- * Check if onboarding has already been marked as completed
80
- */
81
- hasOnboardingBeenCompleted(): Promise<boolean>;
82
- /**
83
- * Mark onboarding as completed in persistent storage
84
- */
85
- private markOnboardingAsCompleted;
86
- /**
87
- * Reset onboarding completion status (useful for testing or user reset)
88
- */
89
- resetOnboardingCompletionStatus(): Promise<void>;
90
- /**
91
- * Track onboarding completed event - fires ONCE per user
79
+ * Track onboarding completed event
92
80
  * Called when:
93
81
  * 1. User completes the onboarding flow (onboarding-finished action)
94
82
  * 2. User closes the onboarding (close action)
@@ -99,7 +87,7 @@ declare class EventManager {
99
87
  * @param totalSteps - Total number of steps in the onboarding
100
88
  * @param onboardingId - The onboarding ID
101
89
  */
102
- trackOnboardingCompletedOnce(trigger: string, completedSteps?: number, totalSteps?: number, onboardingId?: string): Promise<void>;
90
+ trackOnboardingCompleted(trigger: string, completedSteps?: number, totalSteps?: number, onboardingId?: string): void;
103
91
  /**
104
92
  * Track notification response
105
93
  */
@@ -6,7 +6,6 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.EventManager = exports.eventManager = void 0;
8
8
  const constants_1 = require("./constants");
9
- const RampKitNative_1 = require("./RampKitNative");
10
9
  /**
11
10
  * Generate a UUID v4 using Math.random
12
11
  * This is sufficient for event IDs - no crypto dependency needed
@@ -224,46 +223,10 @@ class EventManager {
224
223
  this.endOnboardingTracking();
225
224
  }
226
225
  // ============================================================================
227
- // Onboarding Completion (Once Per User)
226
+ // Onboarding Completion
228
227
  // ============================================================================
229
228
  /**
230
- * Check if onboarding has already been marked as completed
231
- */
232
- async hasOnboardingBeenCompleted() {
233
- try {
234
- const value = await (0, RampKitNative_1.getStoredValue)(constants_1.STORAGE_KEYS.ONBOARDING_COMPLETED);
235
- return value === "true";
236
- }
237
- catch (_a) {
238
- return false;
239
- }
240
- }
241
- /**
242
- * Mark onboarding as completed in persistent storage
243
- */
244
- async markOnboardingAsCompleted() {
245
- try {
246
- await (0, RampKitNative_1.setStoredValue)(constants_1.STORAGE_KEYS.ONBOARDING_COMPLETED, "true");
247
- console.log("[RampKit] EventManager: onboarding marked as completed (persisted)");
248
- }
249
- catch (error) {
250
- console.warn("[RampKit] EventManager: failed to persist onboarding completion:", error);
251
- }
252
- }
253
- /**
254
- * Reset onboarding completion status (useful for testing or user reset)
255
- */
256
- async resetOnboardingCompletionStatus() {
257
- try {
258
- await (0, RampKitNative_1.setStoredValue)(constants_1.STORAGE_KEYS.ONBOARDING_COMPLETED, "");
259
- console.log("[RampKit] EventManager: onboarding completion status reset");
260
- }
261
- catch (error) {
262
- console.warn("[RampKit] EventManager: failed to reset onboarding completion:", error);
263
- }
264
- }
265
- /**
266
- * Track onboarding completed event - fires ONCE per user
229
+ * Track onboarding completed event
267
230
  * Called when:
268
231
  * 1. User completes the onboarding flow (onboarding-finished action)
269
232
  * 2. User closes the onboarding (close action)
@@ -274,16 +237,9 @@ class EventManager {
274
237
  * @param totalSteps - Total number of steps in the onboarding
275
238
  * @param onboardingId - The onboarding ID
276
239
  */
277
- async trackOnboardingCompletedOnce(trigger, completedSteps, totalSteps, onboardingId) {
278
- // Check if already completed - skip if so
279
- const alreadyCompleted = await this.hasOnboardingBeenCompleted();
280
- if (alreadyCompleted) {
281
- console.log(`[RampKit] EventManager: onboarding_completed already sent, skipping (trigger: ${trigger})`);
282
- return;
283
- }
284
- // Mark as completed BEFORE sending to prevent race conditions
285
- await this.markOnboardingAsCompleted();
240
+ trackOnboardingCompleted(trigger, completedSteps, totalSteps, onboardingId) {
286
241
  const timeToCompleteSeconds = this.getOnboardingDurationSeconds();
242
+ console.log(`[RampKit] EventManager: 📊 onboarding_completed`, `\n trigger: ${trigger}`, `\n onboardingId: ${onboardingId || this.currentOnboardingId}`, `\n timeToCompleteSeconds: ${timeToCompleteSeconds}`);
287
243
  this.track("onboarding_completed", {
288
244
  onboardingId: onboardingId || this.currentOnboardingId,
289
245
  timeToCompleteSeconds,
@@ -292,7 +248,6 @@ class EventManager {
292
248
  trigger,
293
249
  });
294
250
  this.endOnboardingTracking();
295
- console.log(`[RampKit] EventManager: 📊 onboarding_completed sent (trigger: ${trigger})`);
296
251
  }
297
252
  /**
298
253
  * Track notification response
@@ -364,8 +319,6 @@ class EventManager {
364
319
  this.onboardingStartTime = null;
365
320
  this.currentOnboardingId = null;
366
321
  this.initialized = false;
367
- // Reset onboarding completion status so it can fire again for new user
368
- this.resetOnboardingCompletionStatus();
369
322
  }
370
323
  }
371
324
  exports.EventManager = EventManager;
package/build/RampKit.js CHANGED
@@ -289,16 +289,16 @@ class RampKitCore {
289
289
  navigation,
290
290
  onOnboardingFinished: (payload) => {
291
291
  var _a;
292
- // Track onboarding completed (once per user) - trigger: finished
293
- EventManager_1.eventManager.trackOnboardingCompletedOnce("finished", screens.length, screens.length, onboardingId);
292
+ // Track onboarding completed - trigger: finished
293
+ EventManager_1.eventManager.trackOnboardingCompleted("finished", screens.length, screens.length, onboardingId);
294
294
  try {
295
295
  (_a = this.onOnboardingFinished) === null || _a === void 0 ? void 0 : _a.call(this, payload);
296
296
  }
297
297
  catch (_) { }
298
298
  },
299
299
  onShowPaywall: (payload) => {
300
- // Track onboarding completed (once per user) - trigger: paywall_shown
301
- EventManager_1.eventManager.trackOnboardingCompletedOnce("paywall_shown", screens.length, // We don't know exact step, use total
300
+ // Track onboarding completed - trigger: paywall_shown
301
+ EventManager_1.eventManager.trackOnboardingCompleted("paywall_shown", screens.length, // We don't know exact step, use total
302
302
  screens.length, onboardingId);
303
303
  // Call the original callback
304
304
  const paywallCallback = (opts === null || opts === void 0 ? void 0 : opts.onShowPaywall) || (opts === null || opts === void 0 ? void 0 : opts.showPaywall) || this.onShowPaywall;
@@ -315,8 +315,8 @@ class RampKitCore {
315
315
  EventManager_1.eventManager.trackNotificationsResponse(granted ? "granted" : "denied");
316
316
  },
317
317
  onCloseAction: (screenIndex, _screenId) => {
318
- // Track onboarding completed (once per user) - trigger: closed
319
- EventManager_1.eventManager.trackOnboardingCompletedOnce("closed", screenIndex + 1, screens.length, onboardingId);
318
+ // Track onboarding completed - trigger: closed
319
+ EventManager_1.eventManager.trackOnboardingCompleted("closed", screenIndex + 1, screens.length, onboardingId);
320
320
  },
321
321
  });
322
322
  }
@@ -14,7 +14,6 @@ export declare const STORAGE_KEYS: {
14
14
  readonly LAUNCH_COUNT: "rk_launch_count";
15
15
  readonly LAST_LAUNCH: "rk_last_launch";
16
16
  readonly ONBOARDING_RESPONSES: "rk_onboarding_responses";
17
- readonly ONBOARDING_COMPLETED: "rk_onboarding_completed";
18
17
  };
19
18
  export declare const CAPABILITIES: readonly ["onboarding", "paywall_event_receiver", "haptic_feedback", "push_notifications"];
20
19
  export declare const SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV1c3RsenV2am1vY2h4a3hhdGZ4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjIxMDM2NTUsImV4cCI6MjA3NzY3OTY1NX0.d5XsIMGnia4n9Pou0IidipyyEfSlwpXFoeDBufMOEwE";
@@ -20,8 +20,6 @@ exports.STORAGE_KEYS = {
20
20
  LAST_LAUNCH: "rk_last_launch",
21
21
  // Onboarding responses (persisted)
22
22
  ONBOARDING_RESPONSES: "rk_onboarding_responses",
23
- // Onboarding completion status (persisted) - fires once per user
24
- ONBOARDING_COMPLETED: "rk_onboarding_completed",
25
23
  };
26
24
  exports.CAPABILITIES = [
27
25
  "onboarding",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rampkit-expo-dev",
3
- "version": "0.0.63",
3
+ "version": "0.0.64",
4
4
  "description": "The Expo SDK for RampKit. Build, test, and personalize app onboardings with instant updates.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",