@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 CHANGED
@@ -1,75 +1,120 @@
1
- # @allstak-io/react-native
1
+ # @allstak/react-native
2
2
 
3
- AllStak React Native SDK `ErrorUtils` + Hermes rejection tracking + Platform device tags.
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
- ## Install
5
+ [![npm version](https://img.shields.io/npm/v/@allstak/react-native.svg)](https://www.npmjs.com/package/@allstak/react-native)
6
+ [![CI](https://github.com/allstak-io/allstak-react-native/actions/workflows/ci.yml/badge.svg)](https://github.com/allstak-io/allstak-react-native/actions)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
8
 
8
- > **Auth required:** GitHub Packages requires a token with `read:packages` scope.
9
+ Official AllStak SDK for React Native hooks `ErrorUtils`, Hermes rejection tracking, and native crash capture on iOS and Android.
9
10
 
10
- ### 1. Configure `.npmrc`
11
+ ## Dashboard
11
12
 
12
- ```ini
13
- @allstak-io:registry=https://npm.pkg.github.com
14
- //npm.pkg.github.com/:_authToken=YOUR_GITHUB_PAT
15
- ```
13
+ View captured events live at [app.allstak.sa](https://app.allstak.sa).
14
+
15
+ ![AllStak dashboard](https://app.allstak.sa/images/dashboard-preview.png)
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
- ### 2. Install
37
+ ## Installation
18
38
 
19
39
  ```bash
20
- npm install @allstak-io/react-native@0.1.1 @allstak-io/core@0.1.1
21
- # react-native >=0.70 is an optional peer dep
40
+ npm install @allstak/react-native
22
41
  ```
23
42
 
24
- ## Usage
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-io/core';
28
- import { installReactNative } from '@allstak-io/react-native';
48
+ import { installReactNative, AllStak } from '@allstak/react-native';
29
49
 
30
- // Initialize the base SDK
31
- AllStak.init({
50
+ installReactNative({
32
51
  apiKey: process.env.ALLSTAK_API_KEY!,
33
52
  environment: 'production',
34
- release: 'v1.0.0',
35
- // ingest: 'https://api.allstak.sa' ← default
53
+ release: 'mobile@1.0.0',
36
54
  });
37
55
 
38
- // Install RN-specific instrumentation
39
- installReactNative({
40
- // Hooks ErrorUtils for uncaught JS errors
41
- // Installs Hermes rejection tracking
42
- // Tags every event with Platform.OS and Platform.Version
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
- ## What's captured automatically after `installReactNative()`
91
+ Send a log from a screen:
47
92
 
48
- | Capability | Notes |
49
- |-----------|-------|
50
- | Uncaught JS errors | Via `ErrorUtils.setGlobalHandler` |
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
- ## Native crash capture (Android/iOS)
97
+ Tag the current build channel:
55
98
 
56
- Native modules for Java/Kotlin (Android) and Obj-C/Swift (iOS) crash capture are in `./native/`. See [`native/README.md`](./native/README.md) for platform-specific setup.
99
+ ```ts
100
+ AllStak.setTag('release-channel', 'beta');
101
+ AllStak.setUser({ id: userId });
102
+ ```
57
103
 
58
- ## API
104
+ ## Production Endpoint
59
105
 
60
- | Export | Description |
61
- |--------|-------------|
62
- | `AllStak` | Re-exported from `@allstak-io/core` |
63
- | `installReactNative(opts?)` | Hooks ErrorUtils + Hermes + device tags |
64
- | `ReactNativeInstallOptions` | Options type for `installReactNative` |
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
- ## GitHub Packages
112
+ ## Links
67
113
 
68
- - **Package:** `@allstak-io/react-native`
69
- - **Registry:** `https://npm.pkg.github.com`
70
- - **Repo:** [github.com/allstak-io/allstak-react-native](https://github.com/allstak-io/allstak-react-native)
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
- ## Versioning
118
+ ## License
74
119
 
75
- Tags must match `package.json` version exactly (e.g. `v0.1.1`). The release workflow fails if there's a mismatch.
120
+ MIT © AllStak
package/dist/index.d.mts CHANGED
@@ -1 +1 @@
1
- export { AllStak, ReactNativeInstallOptions, installReactNative } from 'allstak-js/react-native';
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-js/react-native';
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-js/react-native");
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-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":[]}
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
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- import { installReactNative, AllStak } from "allstak-js/react-native";
2
+ import { installReactNative, AllStak } from "@allstak/js/react-native";
3
3
  export {
4
4
  AllStak,
5
5
  installReactNative
@@ -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-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":[]}
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.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.1",
55
- "@allstak/js": "^0.1.1"
54
+ "@allstak/core": "^0.1.3",
55
+ "@allstak/js": "^0.1.3"
56
56
  },
57
57
  "devDependencies": {
58
58
  "tsup": "^8.0.0",