@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
package/src/index.ts
CHANGED
|
@@ -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
|
+
}
|