@sazabi/react-native 0.0.0-stage → 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/dist/chunk-c8j7sr2j.js +5 -0
- package/dist/chunk-c8j7sr2j.js.map +24 -0
- package/dist/client-sdk-core/attributes.d.ts +8 -0
- package/dist/client-sdk-core/clock.d.ts +6 -0
- package/dist/client-sdk-core/console.d.ts +23 -0
- package/dist/client-sdk-core/index.d.ts +21 -0
- package/dist/client-sdk-core/intake-url.d.ts +38 -0
- package/dist/client-sdk-core/network-capture.d.ts +90 -0
- package/dist/client-sdk-core/patch-marker.d.ts +8 -0
- package/dist/client-sdk-core/pointer.d.ts +73 -0
- package/dist/client-sdk-core/random.d.ts +11 -0
- package/dist/client-sdk-core/sdk-health.d.ts +37 -0
- package/dist/client-sdk-core/session.d.ts +44 -0
- package/dist/client-sdk-core/trace-context.d.ts +33 -0
- package/dist/client-sdk-core/transport.d.ts +142 -0
- package/dist/client-sdk-core/types.d.ts +76 -0
- package/dist/client-sdk-core/url.d.ts +30 -0
- package/dist/errors.d.ts +46 -0
- package/dist/host.d.ts +30 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +18 -0
- package/dist/interactions.d.ts +40 -0
- package/dist/lifecycle.d.ts +16 -0
- package/dist/navigation.d.ts +24 -0
- package/dist/network.d.ts +12 -0
- package/dist/outbox.d.ts +53 -0
- package/dist/process-state.d.ts +49 -0
- package/dist/register.d.ts +1 -0
- package/dist/register.js +4 -0
- package/dist/register.js.map +10 -0
- package/dist/storage.d.ts +42 -0
- package/dist/types.d.ts +108 -0
- package/dist/version.d.ts +4 -0
- package/package.json +49 -4
- package/README.md +0 -3
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { ConsoleCaptureConfig, NetworkCaptureConfig as CoreNetworkCaptureConfig, PointerCaptureConfig } from "./client-sdk-core/index.js";
|
|
2
|
+
export type { AttributeValue, ClientEvent, ClientEventType, ConsoleCaptureConfig, ConsoleCaptureLevel, EventAttributes, EventSeverity, PointerCaptureConfig, } from "./client-sdk-core/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Persistent key-value storage the SDK writes sessions, identity, and the
|
|
5
|
+
* crash outbox to. `@react-native-async-storage/async-storage`, MMKV
|
|
6
|
+
* wrappers, and `expo-sqlite/kv-store` all satisfy it; a synchronous store
|
|
7
|
+
* makes the crash outbox reliable on a fatal error.
|
|
8
|
+
*/
|
|
9
|
+
export interface StorageAdapter {
|
|
10
|
+
getItem(key: string): string | null | Promise<string | null>;
|
|
11
|
+
setItem(key: string, value: string): void | Promise<void>;
|
|
12
|
+
removeItem(key: string): void | Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Every key the store holds (AsyncStorage's `getAllKeys`, MMKV's
|
|
15
|
+
* `getAllKeys`). Optional: with it, a launch recovers a crash report whose
|
|
16
|
+
* own key was written but whose index entry never landed because the
|
|
17
|
+
* process died between the two writes. Without it such a report is lost.
|
|
18
|
+
*/
|
|
19
|
+
getAllKeys?(): readonly string[] | Promise<readonly string[]>;
|
|
20
|
+
}
|
|
21
|
+
export interface NetworkCaptureConfig extends CoreNetworkCaptureConfig {
|
|
22
|
+
/**
|
|
23
|
+
* Requests eligible for `traceparent` injection. A string is a host
|
|
24
|
+
* (`api.example.com`), a domain with every subdomain (`.example.com`), or
|
|
25
|
+
* an origin with an optional path prefix (`https://api.example.com`); a
|
|
26
|
+
* RegExp is tested against the full URL. Default: every request except
|
|
27
|
+
* the intake endpoint. A native app has no origin and no CORS preflight,
|
|
28
|
+
* so injection is on everywhere unless narrowed here.
|
|
29
|
+
*/
|
|
30
|
+
allowlist?: (string | RegExp)[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What `HermesInternal.enablePromiseRejectionTracker` takes: the shape every
|
|
34
|
+
* React Native crash reporter installs.
|
|
35
|
+
*/
|
|
36
|
+
export interface RejectionTracker {
|
|
37
|
+
allRejections: boolean;
|
|
38
|
+
onUnhandled(id: number, rejection: unknown): void;
|
|
39
|
+
onHandled?(id: number): void;
|
|
40
|
+
}
|
|
41
|
+
export interface ErrorCaptureConfig {
|
|
42
|
+
/**
|
|
43
|
+
* Track unhandled promise rejections through Hermes's rejection tracker.
|
|
44
|
+
* Hermes has one tracker slot, so turn this off when another SDK owns it.
|
|
45
|
+
* Default true.
|
|
46
|
+
*/
|
|
47
|
+
unhandledRejections?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The tracker another library installed before `init()`, to run after the
|
|
50
|
+
* SDK's own on every rejection. Hermes gives no way to read the slot's
|
|
51
|
+
* occupant (`HermesInternal` is frozen and its global pinned), so `init()`
|
|
52
|
+
* replaces whatever holds it; hand that tracker over here to keep it
|
|
53
|
+
* running. A tracker installed after `init()` replaces the SDK's instead.
|
|
54
|
+
*/
|
|
55
|
+
previousRejectionTracker?: RejectionTracker;
|
|
56
|
+
}
|
|
57
|
+
/** The subset of a React Navigation container ref the SDK subscribes to. */
|
|
58
|
+
export interface NavigationContainerRefLike {
|
|
59
|
+
addListener(type: "state", listener: () => void): () => void;
|
|
60
|
+
getCurrentRoute(): {
|
|
61
|
+
key?: string | undefined;
|
|
62
|
+
name: string;
|
|
63
|
+
params?: object | undefined;
|
|
64
|
+
path?: string | undefined;
|
|
65
|
+
} | undefined;
|
|
66
|
+
}
|
|
67
|
+
export interface ReactNativeSdkConfig {
|
|
68
|
+
/**
|
|
69
|
+
* The project's intake URL, exactly as the log source issues it, e.g.
|
|
70
|
+
* `https://<key>.us-west-2.intake.sazabi.com`. The credential is embedded in
|
|
71
|
+
* the hostname, so this is normally the only endpoint config needed; `/v1/logs`
|
|
72
|
+
* may be included or omitted.
|
|
73
|
+
*/
|
|
74
|
+
intakeUrl?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Public ingest key (`sazabi_public_...`). Optional: derived from `intakeUrl`
|
|
77
|
+
* when that URL is a keyed intake host. Set it only for a proxy or custom
|
|
78
|
+
* endpoint whose hostname carries no key.
|
|
79
|
+
*/
|
|
80
|
+
publicKey?: string;
|
|
81
|
+
/** Logical service name for the app. */
|
|
82
|
+
serviceName: string;
|
|
83
|
+
/** App version (e.g. the marketing version or a git SHA). */
|
|
84
|
+
serviceVersion?: string;
|
|
85
|
+
/** Deployment environment (e.g. "production"). */
|
|
86
|
+
environment?: string;
|
|
87
|
+
/** Session persistence and the crash outbox. Without it, sessions last one launch. */
|
|
88
|
+
storage?: StorageAdapter;
|
|
89
|
+
network?: NetworkCaptureConfig;
|
|
90
|
+
console?: ConsoleCaptureConfig;
|
|
91
|
+
pointer?: PointerCaptureConfig;
|
|
92
|
+
errors?: ErrorCaptureConfig;
|
|
93
|
+
/**
|
|
94
|
+
* Consent gate: capture holds until this resolves true. When it resolves
|
|
95
|
+
* false the SDK stays dormant.
|
|
96
|
+
*/
|
|
97
|
+
consent?: () => boolean | Promise<boolean>;
|
|
98
|
+
/** Batch flush cadence in ms. Default 5000. */
|
|
99
|
+
flushIntervalMs?: number;
|
|
100
|
+
/** Soft cap per OTLP request body in bytes. Default 57344. */
|
|
101
|
+
maxBatchBytes?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Max buffered events (and at most 1 MiB) while the intake is unreachable;
|
|
104
|
+
* the oldest are dropped first and counted in `app.sdk.dropped_events`.
|
|
105
|
+
* Default 500.
|
|
106
|
+
*/
|
|
107
|
+
maxQueuedEvents?: number;
|
|
108
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sazabi/react-native",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"description": "Sazabi React Native observability SDK — semantic event stream capture with W3C trace context propagation",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./register": {
|
|
14
|
+
"types": "./dist/register.d.ts",
|
|
15
|
+
"default": "./dist/register.js"
|
|
16
|
+
},
|
|
17
|
+
"./dist/register.js": {
|
|
18
|
+
"types": "./dist/register.d.ts",
|
|
19
|
+
"default": "./dist/register.js"
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"react-native": {
|
|
24
|
+
"./register": "./dist/register.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": ">=18",
|
|
31
|
+
"react-native": ">=0.76"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"react-native": {
|
|
35
|
+
"optional": true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": [
|
|
39
|
+
"./dist/register.js"
|
|
40
|
+
],
|
|
41
|
+
"license": "Apache-2.0",
|
|
42
|
+
"homepage": "https://github.com/sazabi/react-native",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/sazabi/react-native.git"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"registry": "https://registry.npmjs.org"
|
|
50
|
+
}
|
|
51
|
+
}
|
package/README.md
DELETED