@goliapkg/sentori-react-native 1.2.0 → 2.0.0

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/README.md CHANGED
@@ -1,5 +1,65 @@
1
- # @sentori/react-native
1
+ # @goliapkg/sentori-react-native
2
2
 
3
- React Native SDK — JS / iOS native / Android native error capture.
3
+ React Native SDK for [Sentori](https://sentori.golia.jp) — JS layer
4
+ + iOS Swift + Android Kotlin native, distributed as an Expo module
5
+ (works on bare RN too).
4
6
 
5
- JS layer in **Phase 3**, native layers in **Phase 7**. Currently a placeholder.
7
+ ## Install
8
+
9
+ ```sh
10
+ bun add @goliapkg/sentori-react-native
11
+ cd ios && pod install --repo-update
12
+ ```
13
+
14
+ ## Use
15
+
16
+ ```tsx
17
+ import { sentori } from '@goliapkg/sentori-react-native'
18
+
19
+ sentori.init({
20
+ token: 'st_pk_…',
21
+ release: 'my-app@1.2.3',
22
+ environment: 'prod',
23
+ capture: {
24
+ replay: { mode: 'wireframe', hz: 1 },
25
+ },
26
+ })
27
+
28
+ sentori.captureException(new Error('boom'))
29
+ ```
30
+
31
+ Auto-wired:
32
+
33
+ - JS `error` / `unhandledrejection` global hooks
34
+ - iOS `NSException` handler primed by `init`
35
+ - Android uncaught exception handler primed by `init`
36
+ - Native screenshot + view-tree capture under JS-supplied mask IDs
37
+ - Hang watchdog (main blocked > 2s emits `kind: "anr"`)
38
+ - Wireframe replay sampler (60 slots × ~120 bytes/frame at idle)
39
+
40
+ ## Cross-project user lookup (PII-safe)
41
+
42
+ ```ts
43
+ sentori.setUser({ linkBy: { email: user.email } })
44
+ ```
45
+
46
+ Identity is hashed on-device with a per-org salt. The server never
47
+ sees the raw email / phone.
48
+
49
+ ## Sentry compat drop-in
50
+
51
+ ```ts
52
+ import * as Sentry from '@goliapkg/sentori-react-native/compat'
53
+
54
+ Sentry.init({ dsn: 'st_pk_…' })
55
+ Sentry.captureException(err)
56
+ ```
57
+
58
+ → Full guide: [sentori.golia.jp/docs/getting-started/react-native](https://sentori.golia.jp/docs/getting-started/react-native)
59
+ → Privacy contract: [sentori.golia.jp/docs/privacy/identity](https://sentori.golia.jp/docs/privacy/identity)
60
+ → Sentry translation: [sentori.golia.jp/docs/sentry-compat](https://sentori.golia.jp/docs/sentry-compat)
61
+
62
+ ## License
63
+
64
+ Dual-licensed under [Apache-2.0](../../LICENSE-APACHE) OR
65
+ [MIT](../../LICENSE-MIT).
@@ -0,0 +1,112 @@
1
+ /**
2
+ * v2.3 W6.3 — Sentry-compatible API surface.
3
+ *
4
+ * Drop-in for code (or LLM-generated code) written against
5
+ * `@sentry/react-native`. Every Sentry call maps to exactly one
6
+ * Sentori-native call internally. Translation differences (e.g.
7
+ * `Sentry.setUser({ ip_address })` — Sentori never stores IP) fire
8
+ * a one-shot console hint at `info` level, deduplicated per
9
+ * (api, dropped_field).
10
+ *
11
+ * Why this exists: LLMs have seen a LOT of Sentry code; letting
12
+ * them write the same syntax against Sentori is one less thing
13
+ * Sentori asks the host to think about. Combined with the v2.3
14
+ * "free bonus" stance — host adds Sentori without unlearning
15
+ * anything.
16
+ *
17
+ * Usage:
18
+ *
19
+ * import * as Sentry from '@goliapkg/sentori-react-native/compat'
20
+ *
21
+ * Sentry.init({ dsn: 'https://<token>@<host>/<projectId>', ... })
22
+ * Sentry.captureException(err)
23
+ * Sentry.setUser({ id, email }) // email → linkBy.email (hashed)
24
+ *
25
+ * The compat layer holds NO state of its own — it's a thin shim
26
+ * over the same Sentori internals. Mixing `Sentry.*` and
27
+ * `sentori.*` calls in the same app works fine.
28
+ *
29
+ * See `docs/design/sdk-v2.3-redesign.md` §4 for the full
30
+ * translation table + design rationale.
31
+ */
32
+ type SentryInitOpts = {
33
+ dsn: string;
34
+ environment?: string;
35
+ release?: string;
36
+ tracesSampleRate?: number;
37
+ sampleRate?: number;
38
+ attachStacktrace?: boolean;
39
+ autoSessionTracking?: boolean;
40
+ /** Sentry's `debug: true` ≈ Sentori's `logLevel: 'debug'`. */
41
+ debug?: boolean;
42
+ /** Catch-all for fields Sentori either ignores or doesn't map yet. */
43
+ [other: string]: unknown;
44
+ };
45
+ export declare function init(opts: SentryInitOpts): void;
46
+ /** Sentry's severity values, surfaced as strings (Sentori only
47
+ * uses 5 levels). `Log` and `Critical` collapse to `'info'` and
48
+ * `'fatal'` respectively. */
49
+ export declare const Severity: {
50
+ Fatal: "fatal";
51
+ Critical: "fatal";
52
+ Error: "error";
53
+ Warning: "warning";
54
+ Log: "info";
55
+ Info: "info";
56
+ Debug: "debug";
57
+ };
58
+ type SentryLevelString = 'critical' | 'debug' | 'error' | 'fatal' | 'info' | 'log' | 'warning';
59
+ type SentryCaptureContext = {
60
+ tags?: Record<string, string>;
61
+ extra?: Record<string, unknown>;
62
+ level?: SentryLevelString;
63
+ fingerprint?: string[];
64
+ user?: SentrySetUserInput;
65
+ };
66
+ export declare function captureException(err: unknown, hint?: {
67
+ captureContext?: SentryCaptureContext;
68
+ } | SentryCaptureContext): void;
69
+ export declare function captureMessage(msg: string, levelOrCtx?: SentryCaptureContext | SentryLevelString): void;
70
+ type SentrySetUserInput = {
71
+ id?: string;
72
+ email?: string;
73
+ username?: string;
74
+ ip_address?: string;
75
+ segment?: string;
76
+ [other: string]: unknown;
77
+ } | null;
78
+ export declare function setUser(user: SentrySetUserInput): void;
79
+ export declare const setTag: (key: string, value: string) => void;
80
+ export declare const setTags: (record: Record<string, string>) => void;
81
+ type SentryBreadcrumb = {
82
+ category?: string;
83
+ message?: string;
84
+ level?: SentryLevelString;
85
+ type?: 'default' | 'error' | 'http' | 'info' | 'navigation' | 'query' | 'user' | string;
86
+ data?: Record<string, unknown>;
87
+ timestamp?: number;
88
+ };
89
+ export declare function addBreadcrumb(crumb: SentryBreadcrumb): void;
90
+ export { close, flush } from '../lifecycle';
91
+ type SentrySpanOpts = {
92
+ op?: string;
93
+ name?: string;
94
+ description?: string;
95
+ tags?: Record<string, string>;
96
+ };
97
+ export declare function startTransaction(opts: SentrySpanOpts): {
98
+ finish: (status?: 'cancelled' | 'error' | 'ok') => void;
99
+ setStatus: (status: 'cancelled' | 'error' | 'ok') => void;
100
+ setTag: (k: string, v: string) => void;
101
+ startChild: (childOpts: SentrySpanOpts) => unknown;
102
+ };
103
+ type ScopeProxy = {
104
+ setTag: (k: string, v: string) => void;
105
+ setTags: (rec: Record<string, string>) => void;
106
+ setUser: (u: SentrySetUserInput) => void;
107
+ setExtra: (k: string, v: unknown) => void;
108
+ setLevel: (l: SentryLevelString) => void;
109
+ };
110
+ export declare function withScope<T>(fn: (scope: ScopeProxy) => T): T;
111
+ export declare function configureScope(fn: (scope: ScopeProxy) => void): void;
112
+ //# sourceMappingURL=sentry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../src/compat/sentry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAyBH,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,sEAAsE;IACtE,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB,CAAA;AA4BD,wBAAgB,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CA8C/C;AAsBD;;8BAE8B;AAC9B,eAAO,MAAM,QAAQ;;;;;;;;CAQpB,CAAA;AAED,KAAK,iBAAiB,GAClB,UAAU,GACV,OAAO,GACP,OAAO,GACP,OAAO,GACP,MAAM,GACN,KAAK,GACL,SAAS,CAAA;AA0Bb,KAAK,oB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;CACzC,CAAA;AAiBD,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,CAAC,GAAG,CAAC,CAS5D;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI,CAEpE"}
@@ -0,0 +1,326 @@
1
+ /**
2
+ * v2.3 W6.3 — Sentry-compatible API surface.
3
+ *
4
+ * Drop-in for code (or LLM-generated code) written against
5
+ * `@sentry/react-native`. Every Sentry call maps to exactly one
6
+ * Sentori-native call internally. Translation differences (e.g.
7
+ * `Sentry.setUser({ ip_address })` — Sentori never stores IP) fire
8
+ * a one-shot console hint at `info` level, deduplicated per
9
+ * (api, dropped_field).
10
+ *
11
+ * Why this exists: LLMs have seen a LOT of Sentry code; letting
12
+ * them write the same syntax against Sentori is one less thing
13
+ * Sentori asks the host to think about. Combined with the v2.3
14
+ * "free bonus" stance — host adds Sentori without unlearning
15
+ * anything.
16
+ *
17
+ * Usage:
18
+ *
19
+ * import * as Sentry from '@goliapkg/sentori-react-native/compat'
20
+ *
21
+ * Sentry.init({ dsn: 'https://<token>@<host>/<projectId>', ... })
22
+ * Sentry.captureException(err)
23
+ * Sentry.setUser({ id, email }) // email → linkBy.email (hashed)
24
+ *
25
+ * The compat layer holds NO state of its own — it's a thin shim
26
+ * over the same Sentori internals. Mixing `Sentry.*` and
27
+ * `sentori.*` calls in the same app works fine.
28
+ *
29
+ * See `docs/design/sdk-v2.3-redesign.md` §4 for the full
30
+ * translation table + design rationale.
31
+ */
32
+ import { logger } from '@goliapkg/sentori-core';
33
+ import { addBreadcrumb as nativeAddBreadcrumb } from '../breadcrumbs';
34
+ import { captureException as nativeCaptureException, captureMessage as nativeCaptureMessage, setTag as nativeSetTag, setTags as nativeSetTags, setUser as nativeSetUser, } from '../capture';
35
+ import { init as nativeInit } from '../init';
36
+ // ── one-shot warn dedup ───────────────────────────────────────────────────
37
+ const _warnedOnce = new Set();
38
+ function warnOnce(key, msg) {
39
+ if (_warnedOnce.has(key))
40
+ return;
41
+ _warnedOnce.add(key);
42
+ logger.info('compat', msg);
43
+ }
44
+ function parseDsn(dsn) {
45
+ // Sentry DSN shape: `https://<key>@<host>[:port][/<projectId>]`
46
+ // Sentori cares about `<key>` (must be `st_pk_…`) and `<host>`.
47
+ let url;
48
+ try {
49
+ url = new URL(dsn);
50
+ }
51
+ catch {
52
+ throw new Error(`Sentory compat: dsn is not a valid URL: ${dsn}`);
53
+ }
54
+ const key = url.username;
55
+ if (!key) {
56
+ throw new Error(`Sentory compat: dsn missing token in user-info component`);
57
+ }
58
+ if (!key.startsWith('st_pk_')) {
59
+ throw new Error(`Sentory compat: dsn token must start with 'st_pk_' (got prefix '${key.slice(0, 8)}…'). ` +
60
+ `Sentori does not parse Sentry-issued tokens — generate a Sentori project token via the dashboard.`);
61
+ }
62
+ // strip user-info to reconstruct the ingest origin
63
+ const ingestUrl = `${url.protocol}//${url.host}`;
64
+ return { token: key, ingestUrl };
65
+ }
66
+ // ── Sentry.init ───────────────────────────────────────────────────────────
67
+ export function init(opts) {
68
+ const { token, ingestUrl } = parseDsn(opts.dsn);
69
+ const sentoriOpts = {
70
+ token,
71
+ release: opts.release ?? '',
72
+ ingestUrl,
73
+ ...(opts.environment ? { environment: opts.environment } : {}),
74
+ sample: {
75
+ ...(opts.tracesSampleRate !== undefined ? { traces: opts.tracesSampleRate } : {}),
76
+ ...(opts.sampleRate !== undefined ? { errors: opts.sampleRate } : {}),
77
+ },
78
+ ...(opts.debug ? { logLevel: 'debug' } : {}),
79
+ };
80
+ // Empty release is the most common Sentry-init mistake; warn but
81
+ // continue.
82
+ if (!sentoriOpts.release) {
83
+ warnOnce('init:no-release', 'Sentry.init() with no `release` — Sentori requires release for grouping + drop-down menus to make sense. Set `release: "myapp@1.2.3"` for production cuts.');
84
+ // Sentori's init throws when release is empty; provide a
85
+ // reasonable fallback so the rest of the code path works in dev.
86
+ sentoriOpts.release = `unspecified@${Date.now()}`;
87
+ }
88
+ // Pass-through informational hints for ignored fields.
89
+ for (const ignored of [
90
+ 'attachStacktrace',
91
+ 'autoSessionTracking',
92
+ 'integrations',
93
+ 'beforeSend',
94
+ 'beforeBreadcrumb',
95
+ 'maxBreadcrumbs',
96
+ ]) {
97
+ if (ignored in opts) {
98
+ warnOnce(`init:ignored:${ignored}`, `Sentry.init({ ${ignored} }) ignored. ` +
99
+ `${getIgnoredHint(ignored)}`);
100
+ }
101
+ }
102
+ nativeInit(sentoriOpts);
103
+ }
104
+ function getIgnoredHint(field) {
105
+ switch (field) {
106
+ case 'attachStacktrace':
107
+ return 'Sentori always sends stack traces — no toggle.';
108
+ case 'autoSessionTracking':
109
+ return "Sentori sessions are on by default; toggle via `init({ capture: { sessions: true|false } })`.";
110
+ case 'integrations':
111
+ return 'Sentori uses `init({ capture: {...} })` toggles instead of Integration classes — see the docs.';
112
+ case 'beforeSend':
113
+ case 'beforeBreadcrumb':
114
+ return 'Sentori does not support an arbitrary beforeSend hook today. Server-side PII scrubbing is automatic.';
115
+ case 'maxBreadcrumbs':
116
+ return 'Sentori uses a fixed 100-slot ring buffer.';
117
+ default:
118
+ return '';
119
+ }
120
+ }
121
+ // ── Severity / level enum ─────────────────────────────────────────────────
122
+ /** Sentry's severity values, surfaced as strings (Sentori only
123
+ * uses 5 levels). `Log` and `Critical` collapse to `'info'` and
124
+ * `'fatal'` respectively. */
125
+ export const Severity = {
126
+ Fatal: 'fatal',
127
+ Critical: 'fatal',
128
+ Error: 'error',
129
+ Warning: 'warning',
130
+ Log: 'info',
131
+ Info: 'info',
132
+ Debug: 'debug',
133
+ };
134
+ function mapLevel(level) {
135
+ if (!level)
136
+ return undefined;
137
+ switch (level) {
138
+ case 'critical':
139
+ warnOnce('severity:critical', "Sentry.Severity.Critical → mapped to 'fatal' (Sentori's 5-level syslog-style scale).");
140
+ return 'fatal';
141
+ case 'log':
142
+ warnOnce('severity:log', "Sentry.Severity.Log → mapped to 'info' (Sentori's 5-level scale has no separate Log).");
143
+ return 'info';
144
+ default:
145
+ return level;
146
+ }
147
+ }
148
+ export function captureException(err, hint) {
149
+ // Sentry v8+ takes the context inline (Hint); earlier versions
150
+ // wrapped it in `{ captureContext: {...} }`. Accept both.
151
+ const ctx = (() => {
152
+ if (!hint)
153
+ return undefined;
154
+ if ('captureContext' in hint) {
155
+ return hint.captureContext;
156
+ }
157
+ return hint;
158
+ })();
159
+ if (ctx?.extra) {
160
+ warnOnce('captureException:extra', 'Sentry.captureException(err, { extra }) → `extra` mapped to `tags` (Sentori does not have a separate extra namespace).');
161
+ }
162
+ if (ctx?.user) {
163
+ // Apply the per-call user via setUser (Sentori takes the
164
+ // current scope user automatically).
165
+ setUser(ctx.user);
166
+ }
167
+ const mergedTags = {
168
+ ...(ctx?.tags ?? {}),
169
+ ...(ctx?.extra
170
+ ? Object.fromEntries(Object.entries(ctx.extra).map(([k, v]) => [k, String(v)]))
171
+ : {}),
172
+ };
173
+ nativeCaptureException(err, {
174
+ ...(Object.keys(mergedTags).length > 0 ? { tags: mergedTags } : {}),
175
+ ...(ctx?.fingerprint ? { fingerprint: ctx.fingerprint } : {}),
176
+ });
177
+ }
178
+ // ── captureMessage ────────────────────────────────────────────────────────
179
+ export function captureMessage(msg, levelOrCtx) {
180
+ let level;
181
+ let tags;
182
+ if (typeof levelOrCtx === 'string') {
183
+ level = mapLevel(levelOrCtx);
184
+ }
185
+ else if (levelOrCtx) {
186
+ level = mapLevel(levelOrCtx.level);
187
+ tags = levelOrCtx.tags;
188
+ }
189
+ nativeCaptureMessage(msg, {
190
+ ...(level ? { level } : {}),
191
+ ...(tags ? { tags } : {}),
192
+ });
193
+ }
194
+ export function setUser(user) {
195
+ if (user == null) {
196
+ nativeSetUser(null);
197
+ return;
198
+ }
199
+ const { id, email, username, ip_address, segment, ...rest } = user;
200
+ if (ip_address !== undefined) {
201
+ warnOnce('setUser:ip_address', 'Sentry.setUser({ ip_address }) → dropped. Sentori never stores IP (privacy by design).');
202
+ }
203
+ if (segment !== undefined) {
204
+ warnOnce('setUser:segment', 'Sentry.setUser({ segment }) → mapped to tag `user.segment`. Set via setTag for clarity.');
205
+ if (typeof segment === 'string')
206
+ nativeSetTag('user.segment', segment);
207
+ }
208
+ const linkBy = {};
209
+ if (email)
210
+ linkBy.email = email;
211
+ if (username)
212
+ linkBy.username = username;
213
+ // Surface any other fields the host bolted on (Sentry historically
214
+ // accepted arbitrary keys) — they pass through as tags.
215
+ for (const [k, v] of Object.entries(rest)) {
216
+ if (v !== undefined && v !== null)
217
+ nativeSetTag(`user.${k}`, String(v));
218
+ }
219
+ nativeSetUser({
220
+ ...(id ? { id } : {}),
221
+ ...(Object.keys(linkBy).length > 0 ? { linkBy } : {}),
222
+ });
223
+ }
224
+ // ── setTag / setTags ──────────────────────────────────────────────────────
225
+ // Re-export Sentori-native semantics; identical signatures.
226
+ export const setTag = nativeSetTag;
227
+ export const setTags = nativeSetTags;
228
+ function mapCategoryToType(category) {
229
+ if (!category)
230
+ return undefined;
231
+ if (['auth', 'click', 'gesture', 'input', 'touch', 'ui'].includes(category))
232
+ return 'user';
233
+ if (['fetch', 'http', 'xhr'].includes(category))
234
+ return 'net';
235
+ if (['nav', 'navigation', 'route'].includes(category))
236
+ return 'nav';
237
+ if (['console', 'log', 'sentry'].includes(category))
238
+ return 'log';
239
+ return 'custom';
240
+ }
241
+ function mapSentryType(t) {
242
+ if (!t)
243
+ return undefined;
244
+ switch (t) {
245
+ case 'http':
246
+ return 'net';
247
+ case 'navigation':
248
+ return 'nav';
249
+ case 'user':
250
+ case 'log':
251
+ case 'custom':
252
+ return t;
253
+ default:
254
+ return 'custom';
255
+ }
256
+ }
257
+ export function addBreadcrumb(crumb) {
258
+ if (!crumb.message) {
259
+ crumb.message = crumb.category ?? crumb.type ?? '(no message)';
260
+ }
261
+ if (crumb.category && !crumb.type) {
262
+ warnOnce('breadcrumb:category', 'Sentry.addBreadcrumb({ category }) → mapped to `type` via well-known table; the category string itself is preserved under `data.category`.');
263
+ }
264
+ // RN SDK shape: { type, data }. No top-level `message` —
265
+ // Sentry's message goes into data.message.
266
+ nativeAddBreadcrumb({
267
+ type: mapSentryType(crumb.type) ?? mapCategoryToType(crumb.category) ?? 'custom',
268
+ data: {
269
+ message: crumb.message,
270
+ ...(crumb.data ?? {}),
271
+ ...(crumb.category ? { category: crumb.category } : {}),
272
+ ...(crumb.level ? { level: mapLevel(crumb.level) } : {}),
273
+ },
274
+ });
275
+ }
276
+ // ── flush / close ─────────────────────────────────────────────────────────
277
+ // Re-export Sentori native flush + close — same signatures.
278
+ export { close, flush } from '../lifecycle';
279
+ // ── startTransaction / startSpan / withScope ──────────────────────────────
280
+ // Trace mapping is non-trivial (Sentry's transaction object exposes
281
+ // startChild, etc.). v2.3 ships a minimum-viable Sentry trace
282
+ // surface that supports startTransaction returning a Sentori Span
283
+ // object with a partial Sentry-style API (.startChild, .finish).
284
+ // Anything beyond that throws a clear error directing to the native
285
+ // `sentori.startSpan` / `sentori.withScopedSpan`.
286
+ import { startSpan } from '@goliapkg/sentori-core';
287
+ export function startTransaction(opts) {
288
+ warnOnce('startTransaction', 'Sentry.startTransaction() → mapped to sentori.startSpan() with op as name. Native equivalent: sentori.startTrace(name) or sentori.startSpan({ name }).');
289
+ const name = opts.name ?? opts.op ?? 'transaction';
290
+ const span = startSpan(name, {
291
+ parent: null,
292
+ tags: opts.tags,
293
+ });
294
+ return {
295
+ finish: (status) => span.finish({ status: status === 'ok' ? 'ok' : 'error' }),
296
+ setStatus: (status) => { span.setTag('status', status); },
297
+ setTag: (k, v) => { span.setTag(k, v); },
298
+ startChild: (childOpts) => {
299
+ return startSpan(childOpts.name ?? childOpts.op ?? 'child', {
300
+ tags: childOpts.tags,
301
+ });
302
+ },
303
+ };
304
+ }
305
+ function scopeProxy() {
306
+ return {
307
+ setTag: nativeSetTag,
308
+ setTags: nativeSetTags,
309
+ setUser,
310
+ setExtra: (k, v) => nativeSetTag(`extra.${k}`, String(v)),
311
+ setLevel: () => {
312
+ warnOnce('scope:setLevel', 'Sentry.withScope(s => s.setLevel(…)) → not supported. Sentori levels travel on capture call, not on scope.');
313
+ },
314
+ };
315
+ }
316
+ export function withScope(fn) {
317
+ // Sentori has no Hub; tags set inside `fn` persist (best-effort
318
+ // approximation of Sentry semantics). For most callers this is
319
+ // fine; tighter isolation needs an actual Hub which we don't ship.
320
+ warnOnce('withScope', 'Sentry.withScope() → tag mutations are NOT auto-reverted on scope exit. Use sentori.setTag/clearTags explicitly for tight isolation.');
321
+ return fn(scopeProxy());
322
+ }
323
+ export function configureScope(fn) {
324
+ fn(scopeProxy());
325
+ }
326
+ //# sourceMappingURL=sentry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.js","sourceRoot":"","sources":["../../src/compat/sentry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE/C,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACrE,OAAO,EACL,gBAAgB,IAAI,sBAAsB,EAC1C,cAAc,IAAI,oBAAoB,EACtC,MAAM,IAAI,YAAY,EACtB,OAAO,IAAI,aAAa,EACxB,OAAO,IAAI,aAAa,GACzB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAoB,IAAI,IAAI,UAAU,EAAE,MAAM,SAAS,CAAA;AAE9D,6EAA6E;AAE7E,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAA;AACrC,SAAS,QAAQ,CAAC,GAAW,EAAE,GAAW;IACxC,IAAI,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAM;IAChC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACpB,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AAC5B,CAAC;AAkBD,SAAS,QAAQ,CAAC,GAAW;IAC3B,gEAA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EAAmE;IACnE,QAAQ,CACN,WAAW,EACX,sIAAsI,CACvI,CAAA;IACD,OAAO,EAAE,CAAC,UAAU,EAAE,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAA+B;IAC5D,EAAE,CAAC,UAAU,EAAE,CAAC,CAAA;AAClB,CAAC"}
package/lib/config.d.ts CHANGED
@@ -37,6 +37,11 @@ export type Config = {
37
37
  * session-trail buffer and uploads it as a `sessionTrail`
38
38
  * attachment. Defaults to false. */
39
39
  sessionTrailEnabled: boolean;
40
+ /** v2.0 W3 — when true, every `track(name, props)` call also
41
+ * pushes a `{ type: 'track', data: { name, props } }` breadcrumb
42
+ * so a subsequent capture carries the customer journey. Defaults
43
+ * to false to preserve v1 customer breadcrumb shape on upgrade. */
44
+ trackAutoBreadcrumb: boolean;
40
45
  /** v2.3 — Sentori console output gate.
41
46
  *
42
47
  * Default `warn`: SDK is silent on host's console unless
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB;sEACkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;wDAEoD;IACpD,MAAM,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,kBAAkB,EAAE,OAAO,CAAC;IAC5B;8CAC0C;IAC1C,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B,eAAe,EAAE,IAAI,GAAG,MAAM,CAAC;IAC/B;yDACqD;IACrD,iBAAiB,EAAE,IAAI,GAAG,MAAM,CAAC;IACjC;;yCAEqC;IACrC,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;;wEAGoE;IACpE,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;;;;;;;mEAQ+D;IAC/D,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;4CAGwC;IACxC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACrC,CAAC;AAIF,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,KAAG,IAE1C,CAAC;AAEF,eAAO,MAAM,SAAS,QAAO,MAAM,GAAG,IAAe,CAAC;AAEtD,eAAO,MAAM,aAAa,QAAO,OAA2B,CAAC;AAE7D,eAAO,MAAM,eAAe,QAAO,IAElC,CAAC"}
package/lib/config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAuDA,IAAI,OAAO,GAAkB,IAAI,CAAC;AAElC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAQ,EAAE;IAChD,OAAO,GAAG,MAAM,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAkB,EAAE,CAAC,OAAO,CAAC;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAY,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC;AAE7D,MAAM,CAAC,MAAM,eAAe,GAAG,GAAS,EAAE;IACxC,OAAO,GAAG,IAAI,CAAC;AACjB,CAAC,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AA4DA,IAAI,OAAO,GAAkB,IAAI,CAAC;AAElC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAQ,EAAE;IAChD,OAAO,GAAG,MAAM,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAkB,EAAE,CAAC,OAAO,CAAC;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAY,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC;AAE7D,MAAM,CAAC,MAAM,eAAe,GAAG,GAAS,EAAE;IACxC,OAAO,GAAG,IAAI,CAAC;AACjB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { FeedbackButton, type FeedbackButtonHandle, type FeedbackButtonProps, } from './feedback-widget';
2
+ //# sourceMappingURL=feedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../src/feedback.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,17 @@
1
+ // v2.0 W3 — `feedback` subpath. The feedback widget pulls in a
2
+ // component tree (react + tsx) and an internal viewer route, so
3
+ // importing it eagerly from the SDK's top-level barrel pays a
4
+ // bundle cost every consumer pays — even ones that never render
5
+ // the widget.
6
+ //
7
+ // Subpath import `@goliapkg/sentori-react-native/feedback`
8
+ // resolves to just the widget surface. Hosts that don't render
9
+ // the feedback button pay zero bundle delta; hosts that do reach
10
+ // for it import via this module and get exactly what they need.
11
+ //
12
+ // Top-level (`index.ts`) still re-exports `FeedbackButton` for one
13
+ // more release cycle so v1 callsites don't break on upgrade. v3
14
+ // will drop the top-level re-export — see
15
+ // `docs/recipes/v1-to-v2-migration.md` for the deprecation timeline.
16
+ export { FeedbackButton, } from './feedback-widget';
17
+ //# sourceMappingURL=feedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback.js","sourceRoot":"","sources":["../src/feedback.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gEAAgE;AAChE,8DAA8D;AAC9D,gEAAgE;AAChE,cAAc;AACd,EAAE;AACF,2DAA2D;AAC3D,+DAA+D;AAC/D,iEAAiE;AACjE,gEAAgE;AAChE,EAAE;AACF,mEAAmE;AACnE,gEAAgE;AAChE,0CAA0C;AAC1C,qEAAqE;AAErE,OAAO,EACL,cAAc,GAGf,MAAM,mBAAmB,CAAA"}
package/lib/init.d.ts CHANGED
@@ -39,6 +39,14 @@ export type InitOptions = {
39
39
  * the buffer is sealed and uploaded as a `sessionTrail`
40
40
  * attachment. Defaults to false. */
41
41
  sessionTrail?: boolean;
42
+ /** v2.0 W3 — when `true`, every `sentori.track(name, props)`
43
+ * also pushes a `{ type: 'track', data: { name, props } }`
44
+ * breadcrumb so a subsequent `captureException` /
45
+ * `captureMessage` carries the customer journey leading up to
46
+ * the failure. Defaults to `false` to preserve v1 customer
47
+ * breadcrumb shape on upgrade; recommended `true` for new
48
+ * integrations. See `docs/recipes/track-and-metrics.md`. */
49
+ trackAutoBreadcrumb?: boolean;
42
50
  /** v0.9.1 +S4 — pre-crash sentinel. Subscribes to JS-thread
43
51
  * frame timing; when ≥ 50% of a 60-frame window misses the
44
52
  * budget (default 32 ms / < 30 fps), emits a `kind: nearCrash`
@@ -100,6 +108,16 @@ export type InitOptions = {
100
108
  * via `sentori.captureMessage()`. `null` / absent → keep all. */
101
109
  messages?: null | number;
102
110
  };
111
+ /** v2.3 — canonical sampling field (renamed from `sampling`).
112
+ * Same shape; if both are passed, `sample` wins. The older
113
+ * `sampling` stays accepted indefinitely as a back-compat alias —
114
+ * this is the kind of rename that's only worth doing if it's
115
+ * also zero-cost for existing callers. */
116
+ sample?: {
117
+ errors?: null | number;
118
+ traces?: null | number;
119
+ messages?: null | number;
120
+ };
103
121
  /** v2.3 — Sentori SDK's own console output gate. Default `'warn'`:
104
122
  * SDK is silent unless something is genuinely broken (transport
105
123
  * sustained failure, native module not found, internal SDK
package/lib/init.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],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SAAS,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;QACvC;;;sEAG8D;QAC9D,gBAAgB,CAAC,EAAE;YACjB,OAAO,EAAE,OAAO,CAAC;YACjB,qBAAqB,CAAC,EAAE,CACtB,IAAI,EAAE,OAAO,sBAAsB,EAAE,eAAe,KAElD,OAAO,sBAAsB,EAAE,iBAAiB,GAChD,OAAO,CAAC,OAAO,sBAAsB,EAAE,iBAAiB,CAAC,CAAC;YAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,SAAS,CAAC,EAAE,MAAM,CAAC;SACpB,CAAC;KACH,CAAC;IACF;;;;;gEAK4D;IAC5D,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACvB;0EACkE;QAClE,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;KAC1B,CAAC;IACF;;;;+CAI2C;IAC3C,MAAM,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;KAC1B,CAAC;IACF;;;;8DAI0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,wBAAwB,EAAE,QAAQ,CAAC;IACrD;;iEAE6D;IAC7D,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACrC,CAAC;AAIF,eAAO,MAAM,IAAI,GAAI,SAAS,WAAW,KAAG,IAoO3C,CAAC;AAqBF,YAAY,EAAE,cAAc,EAAE,CAAC"}
package/lib/init.js CHANGED
@@ -50,10 +50,17 @@ export const init = (options) => {
50
50
  ingestUrl: options.ingestUrl ?? DEFAULT_INGEST_URL,
51
51
  enabled: true,
52
52
  screenshotsEnabled: options.capture?.screenshot === true,
53
- errorSampleRate: options.sampling?.errors ?? null,
54
- traceSampleRate: options.sampling?.traces ?? null,
55
- messageSampleRate: options.sampling?.messages ?? null,
53
+ // v2.3 — `sample` is the canonical name; `sampling` is the
54
+ // back-compat alias. If both are supplied, `sample` wins.
55
+ errorSampleRate: options.sample?.errors ?? options.sampling?.errors ?? null,
56
+ traceSampleRate: options.sample?.traces ?? options.sampling?.traces ?? null,
57
+ messageSampleRate: options.sample?.messages ?? options.sampling?.messages ?? null,
56
58
  sessionTrailEnabled: options.capture?.sessionTrail === true,
59
+ // v2.0 W3 — when true, every `track()` also pushes a
60
+ // `type: 'track'` breadcrumb so a subsequent captureException
61
+ // carries the customer journey. Defaults false to preserve v1
62
+ // breadcrumb shape on upgrade.
63
+ trackAutoBreadcrumb: options.capture?.trackAutoBreadcrumb === true,
57
64
  });
58
65
  // Tell the native crash handler about the config so the JSON it writes
59
66
  // on the next NSException / Java uncaught carries release + env.