@allstak/react-native 0.1.1 → 0.1.3
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 +92 -47
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,75 +1,120 @@
|
|
|
1
|
-
# @allstak
|
|
1
|
+
# @allstak/react-native
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Includes native Android (Kotlin) and iOS (Swift) crash capture modules under `./native/`.
|
|
3
|
+
**Native crash + JS error capture for React Native. iOS and Android auto-wired.**
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@allstak/react-native)
|
|
6
|
+
[](https://github.com/allstak-io/allstak-react-native/actions)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Official AllStak SDK for React Native — hooks `ErrorUtils`, Hermes rejection tracking, and native crash capture on iOS and Android.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
## Dashboard
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
View captured events live at [app.allstak.sa](https://app.allstak.sa).
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- `ErrorUtils.setGlobalHandler` integration for JS crash capture
|
|
20
|
+
- Hermes unhandled promise rejection tracking
|
|
21
|
+
- `Platform.OS` / `Platform.Version` auto-tags on every event
|
|
22
|
+
- Native layers (Obj-C/Swift, Java/Kotlin) ship under `native/` for fatal crash capture
|
|
23
|
+
- Breadcrumbs and user/tag context via the shared core API
|
|
24
|
+
- Works with RN 0.70+
|
|
25
|
+
|
|
26
|
+
## What You Get
|
|
27
|
+
|
|
28
|
+
Once integrated, every event flows to your AllStak dashboard:
|
|
29
|
+
|
|
30
|
+
- **JS errors** — stack traces, component names, Hermes rejections
|
|
31
|
+
- **Native crashes** — iOS (Obj-C/Swift) and Android (Java/Kotlin) fatals
|
|
32
|
+
- **Logs** — structured logs with search and filters
|
|
33
|
+
- **HTTP** — outbound request timing, status codes, failed calls
|
|
34
|
+
- **Device tags** — `Platform.OS`, `Platform.Version`, release channel
|
|
35
|
+
- **Alerts** — email and webhook notifications on regressions
|
|
16
36
|
|
|
17
|
-
|
|
37
|
+
## Installation
|
|
18
38
|
|
|
19
39
|
```bash
|
|
20
|
-
npm install @allstak
|
|
21
|
-
# react-native >=0.70 is an optional peer dep
|
|
40
|
+
npm install @allstak/react-native
|
|
22
41
|
```
|
|
23
42
|
|
|
24
|
-
##
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
> Create a project at [app.allstak.sa](https://app.allstak.sa) to get your API key.
|
|
25
46
|
|
|
26
47
|
```ts
|
|
27
|
-
import { AllStak } from '@allstak-
|
|
28
|
-
import { installReactNative } from '@allstak-io/react-native';
|
|
48
|
+
import { installReactNative, AllStak } from '@allstak/react-native';
|
|
29
49
|
|
|
30
|
-
|
|
31
|
-
AllStak.init({
|
|
50
|
+
installReactNative({
|
|
32
51
|
apiKey: process.env.ALLSTAK_API_KEY!,
|
|
33
52
|
environment: 'production',
|
|
34
|
-
release: '
|
|
35
|
-
// ingest: 'https://api.allstak.sa' ← default
|
|
53
|
+
release: 'mobile@1.0.0',
|
|
36
54
|
});
|
|
37
55
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
AllStak.captureException(new Error('test: hello from allstak-react-native'));
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Run the app — the test error appears in your dashboard within seconds.
|
|
60
|
+
|
|
61
|
+
## Get Your API Key
|
|
62
|
+
|
|
63
|
+
1. Sign up at [app.allstak.sa](https://app.allstak.sa)
|
|
64
|
+
2. Create a project
|
|
65
|
+
3. Copy your API key from **Project Settings → API Keys**
|
|
66
|
+
4. Export it as `ALLSTAK_API_KEY` or pass it to `installReactNative(...)`
|
|
67
|
+
|
|
68
|
+
## Configuration
|
|
69
|
+
|
|
70
|
+
| Option | Type | Required | Default | Description |
|
|
71
|
+
|---|---|---|---|---|
|
|
72
|
+
| `apiKey` | `string` | yes | — | Project API key (`ask_live_…`) |
|
|
73
|
+
| `environment` | `string` | no | — | Deployment env |
|
|
74
|
+
| `release` | `string` | no | — | App version |
|
|
75
|
+
| `host` | `string` | no | `https://api.allstak.sa` | Ingest host override |
|
|
76
|
+
| `user` | `{ id?, email? }` | no | — | Default user context |
|
|
77
|
+
| `tags` | `Record<string,string>` | no | — | Default tags |
|
|
78
|
+
|
|
79
|
+
## Example Usage
|
|
80
|
+
|
|
81
|
+
Capture a caught exception:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
try {
|
|
85
|
+
await api.fetchFeed();
|
|
86
|
+
} catch (e) {
|
|
87
|
+
AllStak.captureException(e as Error, { screen: 'Feed' });
|
|
88
|
+
}
|
|
44
89
|
```
|
|
45
90
|
|
|
46
|
-
|
|
91
|
+
Send a log from a screen:
|
|
47
92
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
| Unhandled promise rejections | Via Hermes rejection tracking |
|
|
52
|
-
| `Platform.OS` / `Platform.Version` tags | Attached to every event |
|
|
93
|
+
```ts
|
|
94
|
+
AllStak.captureMessage('User opened Settings', 'info');
|
|
95
|
+
```
|
|
53
96
|
|
|
54
|
-
|
|
97
|
+
Tag the current build channel:
|
|
55
98
|
|
|
56
|
-
|
|
99
|
+
```ts
|
|
100
|
+
AllStak.setTag('release-channel', 'beta');
|
|
101
|
+
AllStak.setUser({ id: userId });
|
|
102
|
+
```
|
|
57
103
|
|
|
58
|
-
##
|
|
104
|
+
## Production Endpoint
|
|
59
105
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
106
|
+
Production endpoint: `https://api.allstak.sa`. Override via `host` for self-hosted installs:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
installReactNative({ apiKey: '...', host: 'https://allstak.mycorp.com' });
|
|
110
|
+
```
|
|
65
111
|
|
|
66
|
-
##
|
|
112
|
+
## Links
|
|
67
113
|
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
- **Releases:** [github.com/allstak-io/allstak-react-native/releases](https://github.com/allstak-io/allstak-react-native/releases)
|
|
114
|
+
- Documentation: https://docs.allstak.sa
|
|
115
|
+
- Dashboard: https://app.allstak.sa
|
|
116
|
+
- Source: https://github.com/allstak-io/allstak-react-native
|
|
72
117
|
|
|
73
|
-
##
|
|
118
|
+
## License
|
|
74
119
|
|
|
75
|
-
|
|
120
|
+
MIT © AllStak
|
package/dist/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AllStak, ReactNativeInstallOptions, installReactNative } from 'allstak
|
|
1
|
+
export { AllStak, ReactNativeInstallOptions, installReactNative } from '@allstak/js/react-native';
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AllStak, ReactNativeInstallOptions, installReactNative } from 'allstak
|
|
1
|
+
export { AllStak, ReactNativeInstallOptions, installReactNative } from '@allstak/js/react-native';
|
package/dist/index.js
CHANGED
|
@@ -24,5 +24,5 @@ __export(index_exports, {
|
|
|
24
24
|
installReactNative: () => import_react_native.installReactNative
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
var import_react_native = require("allstak
|
|
27
|
+
var import_react_native = require("@allstak/js/react-native");
|
|
28
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @allstak/react-native — React Native public API.\n *\n * Re-exports the RN integration from allstak
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @allstak/react-native — React Native public API.\n *\n * Re-exports the RN integration from @allstak/js/react-native:\n * - installReactNative({...}) — hooks ErrorUtils + Hermes rejection tracking\n * + Platform.OS tags\n *\n * Native-layer crash capture (Java/Kotlin on Android, Obj-C/Swift on iOS)\n * lives under the `native/` directory inside this package. See README.\n */\nexport { installReactNative, type ReactNativeInstallOptions, AllStak } from '@allstak/js/react-native';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,0BAA4E;","names":[]}
|
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @allstak/react-native — React Native public API.\n *\n * Re-exports the RN integration from allstak
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @allstak/react-native — React Native public API.\n *\n * Re-exports the RN integration from @allstak/js/react-native:\n * - installReactNative({...}) — hooks ErrorUtils + Hermes rejection tracking\n * + Platform.OS tags\n *\n * Native-layer crash capture (Java/Kotlin on Android, Obj-C/Swift on iOS)\n * lives under the `native/` directory inside this package. See README.\n */\nexport { installReactNative, type ReactNativeInstallOptions, AllStak } from '@allstak/js/react-native';\n"],"mappings":";AAUA,SAAS,oBAAoD,eAAe;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allstak/react-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "AllStak React Native SDK — ErrorUtils + Hermes rejection tracking + device tags. Depends on @allstak-io/core. Native Android/iOS crash capture modules in ./native.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@allstak/core": "^0.1.
|
|
55
|
-
"@allstak/js": "^0.1.
|
|
54
|
+
"@allstak/core": "^0.1.3",
|
|
55
|
+
"@allstak/js": "^0.1.3"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"tsup": "^8.0.0",
|