@vestara-inc/react-native 0.1.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Ahsan Iqbal
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,208 @@
1
+ # @vestara-inc/react-native
2
+
3
+ React Native SDK for Vestara.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @vestara-inc/react-native
9
+ ```
10
+
11
+ ## Peer Dependencies
12
+
13
+ This package requires:
14
+
15
+ - `react-native` >= 0.71.0
16
+ - `@react-native-async-storage/async-storage` >= 1.21.0
17
+
18
+ ## Quick Start
19
+
20
+ ```ts
21
+ import { Vestara } from "@vestara-inc/react-native";
22
+
23
+ Vestara.init({
24
+ token: "your-sdk-token",
25
+ environment: "production",
26
+ appVersion: "1.0.0",
27
+ targetCategory: "react_native_app",
28
+ serviceName: "React Native App",
29
+ appIdentifier: "react-native-app",
30
+ });
31
+ ```
32
+
33
+ ## Runtime target metadata
34
+
35
+ You can provide metadata to identify this application in the dashboard:
36
+ - `targetCategory`: The kind of target (e.g., `react_native_app`).
37
+ - `serviceName`: Human-readable name (e.g., `React Native App`).
38
+ - `appIdentifier`: Technical identifier (e.g., `react-native-app`).
39
+
40
+ ## API
41
+
42
+ ### `Vestara.init(options)`
43
+
44
+ Initializes the SDK. Must be called before any other API.
45
+
46
+ ```ts
47
+ Vestara.init({
48
+ token: string;
49
+ apiUrl?: string;
50
+ environment?: string;
51
+ appVersion?: string;
52
+ sampleRate?: number; // 0-1, defaults to 1
53
+ targetCategory?: string;
54
+ serviceName?: string;
55
+ appIdentifier?: string;
56
+ beforeSend?: (event) => event | null;
57
+ });
58
+ ```
59
+
60
+ The `beforeSend` hook lets you modify or drop events before they are queued:
61
+
62
+ ```ts
63
+ Vestara.init({
64
+ token: "your-sdk-token",
65
+ beforeSend: (event) => {
66
+ // Redact sensitive user data
67
+ if (event.payload.data?.ssn) {
68
+ const modified = { ...event };
69
+ modified.payload.data = { ...event.payload.data, ssn: "[REDACTED]" };
70
+ return modified;
71
+ }
72
+
73
+ // Drop noisy debug events
74
+ if (event.payload.level === "debug" && event.payload.message?.includes("tick")) {
75
+ return null;
76
+ }
77
+
78
+ return event;
79
+ },
80
+ });
81
+ ```
82
+
83
+ Behavior:
84
+ - Return a modified event to send the modified version
85
+ - Return `null` to drop the event
86
+ - If the hook throws, the original event is sent (fail-open)
87
+
88
+ Note: The Vestara backend also applies server-side redaction as a safety layer.
89
+
90
+ ### `Vestara.log(level, message, data?)`
91
+
92
+ Logs a message at a specific level.
93
+
94
+ ```ts
95
+ Vestara.log("info", "User clicked button", { buttonId: "submit" });
96
+ Vestara.log("warn", "Slow request", { duration: 2000 });
97
+ Vestara.log("error", "API failed", { status: 500 });
98
+ ```
99
+
100
+ Supported levels: `debug`, `info`, `warn`, `error`, `fatal`
101
+
102
+ ### `Vestara.captureError(error, context?)`
103
+
104
+ Manually captures an error with context and breadcrumbs.
105
+
106
+ ```ts
107
+ try {
108
+ riskyOperation();
109
+ } catch (err) {
110
+ Vestara.captureError(err, { operation: "riskyOperation" });
111
+ }
112
+ ```
113
+
114
+ ### `Vestara.setUser({ id, email? })`
115
+
116
+ Associates a user with future events.
117
+
118
+ ```ts
119
+ Vestara.setUser({ id: "user-123", email: "user@example.com" });
120
+ ```
121
+
122
+ ## Custom API URL
123
+
124
+ For local development, staging, or self-hosted deployments, pass `apiUrl`:
125
+
126
+ ```ts
127
+ Vestara.init({
128
+ token: "your-sdk-token",
129
+ apiUrl: "http://10.0.2.2:3000",
130
+ environment: "development",
131
+ });
132
+ ```
133
+
134
+ Do not set `apiUrl` for normal Vestara SaaS usage.
135
+
136
+ ## What is Automatically Captured
137
+
138
+ - **JS Global Errors**: Uncaught exceptions and fatal errors are captured via React Native's ErrorUtils global handler.
139
+ - **Unhandled Promise Rejections**: Rejections without a `.catch()` are captured where available.
140
+ - **App Lifecycle**: Foreground/background transitions create breadcrumbs.
141
+ - **Log Breadcrumbs**: Every `Vestara.log()` call adds a breadcrumb for crash grouping.
142
+ - **Offline Queue**: Events are queued in AsyncStorage when offline, flushed on reconnect.
143
+
144
+ ### `Vestara.trackRumMetric(metricType, value, unit?, name?, screen?, route?, operation?, tags?)`
145
+
146
+ Tracks a Real User Monitoring metric.
147
+
148
+ ```ts
149
+ Vestara.trackRumMetric("screen_load", 450.0, "ms", undefined, "HomeScreen");
150
+ Vestara.trackRumMetric("network_request", 340.0, "ms", "GET /api/users", undefined, "/api/users?token=secret", "GET");
151
+ Vestara.trackRumMetric("custom", 42.0, undefined, "items_loaded", undefined, undefined, undefined, {
152
+ source: "cache",
153
+ count: 15,
154
+ fresh: true,
155
+ });
156
+ ```
157
+
158
+ ### `Vestara.reportAppStart()`
159
+
160
+ Reports app startup duration measured from `Vestara.init()` to this call.
161
+
162
+ ```ts
163
+ // Call after first screen is rendered
164
+ Vestara.reportAppStart();
165
+ ```
166
+
167
+ See the backend contract for accepted `metric_type`, `unit`, and `value` constraints. Tags are bounded client-side (max 20 entries, keys ≤64 chars, string values ≤1024 chars). Non-finite values are dropped. Route query strings and fragments are stripped automatically.
168
+
169
+ ## What is NOT Captured in V1
170
+
171
+ - Native iOS crashes (Swift/Objective-C)
172
+ - Native Android crashes (Java/Kotlin)
173
+ - Native ANRs (Application Not Responding)
174
+ - Session replay
175
+ - Browser/React RUM metrics (use explicit `trackRumMetric`)
176
+ - Native network breadcrumbs
177
+
178
+ ## Device Settings
179
+
180
+ The SDK polls `/v1/sdk/device-settings` every 60 seconds. When `logging_enabled` is `false`, log events are suppressed. Crash events are never suppressed.
181
+
182
+ ## Queue Behavior
183
+
184
+ - Max 500 events in the queue (AsyncStorage persisted).
185
+ - Crash events are never dropped — they evict non-crash events first.
186
+ - Queue is loaded from AsyncStorage on app restart.
187
+ - Events are batch-flushed every 10 seconds; crashes flush immediately.
188
+
189
+ ## Platform
190
+
191
+ - `os_name` is derived from `Platform.OS`: `"ios"` or `"android"`.
192
+ - `os_version` uses `Platform.Version`.
193
+ - `device_model` is `"ios react-native"` or `"android react-native"`.
194
+
195
+ ## Caveats
196
+
197
+ - No native module linking required.
198
+ - No modifications to iOS/Android project files needed.
199
+ - Promise rejection capture depends on React Native version availability; falls back gracefully if unavailable.
200
+ - Global error handler preserves React Native's default behavior (e.g., redbox in dev).
201
+
202
+ ## License
203
+
204
+ This SDK is licensed under the Apache License 2.0.
205
+
206
+ Copyright 2026 Ahsan Iqbal.
207
+
208
+ Vestara, the Vestara name, logos, domain, and related branding are not granted under this license.
@@ -0,0 +1,5 @@
1
+ import type { Breadcrumb } from "./types.js";
2
+ export declare function addBreadcrumb(category: Breadcrumb["category"], message: string, level: Breadcrumb["level"], data?: Record<string, unknown>): void;
3
+ export declare function getSnapshot(): Breadcrumb[];
4
+ export declare function clear(): void;
5
+ //# sourceMappingURL=breadcrumbs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../src/breadcrumbs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7C,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,EAChC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAC1B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,IAAI,CAYN;AAED,wBAAgB,WAAW,IAAI,UAAU,EAAE,CAE1C;AAED,wBAAgB,KAAK,IAAI,IAAI,CAE5B"}
@@ -0,0 +1,21 @@
1
+ const MAX_BREADCRUMBS = 50;
2
+ const crumbs = [];
3
+ export function addBreadcrumb(category, message, level, data) {
4
+ crumbs.push({
5
+ timestamp: new Date().toISOString(),
6
+ category,
7
+ message: message.slice(0, 200),
8
+ level,
9
+ data,
10
+ });
11
+ if (crumbs.length > MAX_BREADCRUMBS) {
12
+ crumbs.shift();
13
+ }
14
+ }
15
+ export function getSnapshot() {
16
+ return crumbs.slice();
17
+ }
18
+ export function clear() {
19
+ crumbs.length = 0;
20
+ }
21
+ //# sourceMappingURL=breadcrumbs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../src/breadcrumbs.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,MAAM,GAAiB,EAAE,CAAC;AAEhC,MAAM,UAAU,aAAa,CAC3B,QAAgC,EAChC,OAAe,EACf,KAA0B,EAC1B,IAA8B;IAE9B,MAAM,CAAC,IAAI,CAAC;QACV,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,QAAQ;QACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;QAC9B,KAAK;QACL,IAAI;KACL,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,GAAG,eAAe,EAAE,CAAC;QACpC,MAAM,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,KAAK;IACnB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,7 @@
1
+ type ErrorHandlerFn = (error: Error, isFatal: boolean) => void;
2
+ export declare function installGlobalErrorHandler(capture: ErrorHandlerFn): void;
3
+ export declare function installUnhandledRejectionHandler(capture: (reason: unknown) => void): void;
4
+ export declare function restoreGlobalHandler(): void;
5
+ export declare function isHandlerInstalled(): boolean;
6
+ export {};
7
+ //# sourceMappingURL=errorHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorHandlers.d.ts","sourceRoot":"","sources":["../src/errorHandlers.ts"],"names":[],"mappings":"AAEA,KAAK,cAAc,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAK/D,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAgBvE;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GACjC,IAAI,CAYN;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAO3C;AAED,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C"}
@@ -0,0 +1,36 @@
1
+ let previousHandler = null;
2
+ let errorHandlerInstalled = false;
3
+ export function installGlobalErrorHandler(capture) {
4
+ if (errorHandlerInstalled)
5
+ return;
6
+ previousHandler = ErrorUtils.getGlobalHandler();
7
+ // Use `as unknown as` to bypass the optional isFatal mismatch in RN types
8
+ ErrorUtils.setGlobalHandler(((error, isFatal) => {
9
+ capture(error, isFatal);
10
+ if (previousHandler) {
11
+ previousHandler(error, isFatal);
12
+ }
13
+ }));
14
+ errorHandlerInstalled = true;
15
+ }
16
+ export function installUnhandledRejectionHandler(capture) {
17
+ const ErrorUtilsAny = ErrorUtils;
18
+ if (typeof ErrorUtilsAny.setUnhandledPromiseRejectionHandler === "function") {
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ ErrorUtilsAny.setUnhandledPromiseRejectionHandler?.(((reason) => {
21
+ capture(reason);
22
+ }));
23
+ }
24
+ }
25
+ export function restoreGlobalHandler() {
26
+ if (errorHandlerInstalled && previousHandler) {
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ ErrorUtils.setGlobalHandler(previousHandler);
29
+ errorHandlerInstalled = false;
30
+ previousHandler = null;
31
+ }
32
+ }
33
+ export function isHandlerInstalled() {
34
+ return errorHandlerInstalled;
35
+ }
36
+ //# sourceMappingURL=errorHandlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorHandlers.js","sourceRoot":"","sources":["../src/errorHandlers.ts"],"names":[],"mappings":"AAIA,IAAI,eAAe,GAA0B,IAAI,CAAC;AAClD,IAAI,qBAAqB,GAAG,KAAK,CAAC;AAElC,MAAM,UAAU,yBAAyB,CAAC,OAAuB;IAC/D,IAAI,qBAAqB;QAAE,OAAO;IAElC,eAAe,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC;IAEhD,0EAA0E;IAC1E,UAAU,CAAC,gBAAgB,CACzB,CAAC,CAAC,KAAY,EAAE,OAAgB,EAAE,EAAE;QAClC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,eAAe,EAAE,CAAC;YACpB,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,CAA4F,CAC9F,CAAC;IAEF,qBAAqB,GAAG,IAAI,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,OAAkC;IAElC,MAAM,aAAa,GAAG,UAGrB,CAAC;IAEF,IAAI,OAAO,aAAa,CAAC,mCAAmC,KAAK,UAAU,EAAE,CAAC;QAC5E,8DAA8D;QAC9D,aAAa,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC,MAAe,EAAE,EAAE;YACvE,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAQ,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,IAAI,qBAAqB,IAAI,eAAe,EAAE,CAAC;QAC7C,8DAA8D;QAC9D,UAAU,CAAC,gBAAgB,CAAC,eAAsB,CAAC,CAAC;QACpD,qBAAqB,GAAG,KAAK,CAAC;QAC9B,eAAe,GAAG,IAAI,CAAC;IACzB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,qBAAqB,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { LogLevel, InitOptions, UserContext, RumMetricType, RumMetricUnit } from "./types.js";
2
+ export declare const Vestara: {
3
+ init(options: InitOptions): Promise<void>;
4
+ log(level: LogLevel, message: string, data?: Record<string, unknown>): void;
5
+ captureError(error: unknown, context?: Record<string, unknown>): Promise<void>;
6
+ setUser(context: UserContext): void;
7
+ trackRumMetric(metricType: RumMetricType, value: number, unit?: RumMetricUnit, name?: string, screen?: string, route?: string, operation?: string, tags?: Record<string, unknown>): void;
8
+ reportAppStart(): void;
9
+ reset(): void;
10
+ __testonly__captureJSError(error: Error, fatal: boolean): Promise<void>;
11
+ __testonly__captureUnhandledRejection(reason: unknown): Promise<void>;
12
+ };
13
+ export default Vestara;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAY,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAkO7G,eAAO,MAAM,OAAO;kBACE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;eA0CpC,QAAQ,WAAW,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;wBA2BjD,OAAO,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;qBAqCnE,WAAW,GAAG,IAAI;+BAMrB,aAAa,SAClB,MAAM,SACN,aAAa,SACb,MAAM,WACJ,MAAM,UACP,MAAM,cACF,MAAM,SACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,IAAI;sBAaW,IAAI;aAKb,IAAI;sCAaqB,KAAK,SAAS,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;kDAIzB,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtE,CAAC;AASF,eAAe,OAAO,CAAC"}