@umituz/react-native-sentry 1.2.0 → 1.2.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-sentry",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Production-ready error tracking and performance monitoring for React Native apps",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -42,5 +42,6 @@ export {
42
42
  trackPackageError,
43
43
  addPackageBreadcrumb,
44
44
  trackPackageWarning,
45
+ trackPackageEvent,
45
46
  } from './presentation/utils/sentryTracking';
46
47
  export type { PackageErrorContext } from './presentation/utils/sentryTracking';
@@ -98,3 +98,33 @@ export function trackPackageWarning(
98
98
  // Silent fallback
99
99
  }
100
100
  }
101
+
102
+ /**
103
+ * Track package lifecycle events (info level)
104
+ * Use this for important user actions and lifecycle events
105
+ *
106
+ * @example
107
+ * trackPackageEvent('subscription', 'paywall_shown', {
108
+ * userId: 'user123',
109
+ * packagesCount: 3
110
+ * });
111
+ */
112
+ export function trackPackageEvent(
113
+ packageName: string,
114
+ eventName: string,
115
+ context?: Record<string, any>
116
+ ): void {
117
+ if (!SentryClient.isInitialized()) return;
118
+
119
+ try {
120
+ SentryClient.captureMessage(`[${packageName}] ${eventName}`, 'info', {
121
+ tags: {
122
+ package: packageName,
123
+ event: eventName,
124
+ },
125
+ extra: context,
126
+ });
127
+ } catch {
128
+ // Silent fallback
129
+ }
130
+ }