yaver-feedback-react-native 0.4.0 → 0.5.2

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 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 describing the origin of the Work and
141
+ 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 SIMKAB ELEKTRIK
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
200
+ implied. See the License for the specific language governing
201
+ permissions and limitations under the License.
package/README.md CHANGED
@@ -23,23 +23,28 @@ npm install react-native-view-shot
23
23
  npm install react-native-audio-recorder-player
24
24
  ```
25
25
 
26
- ## Quick Start
26
+ ## Quick Start (0.5+: zero-config auth)
27
+
28
+ Starting with **0.5.0**, the SDK ships its own login screen + remote machine picker. Drop in `<FeedbackModal />` and the first time a user triggers feedback without a cached session, they get:
29
+
30
+ 1. A full-screen login modal — Apple / Google / GitHub / GitLab / Microsoft via [device-code flow](https://yaver.io/auth/device), or inline email + password.
31
+ 2. A picker of the machines they can reach — **their own dev boxes** plus **guest-shared machines** (where another user invited them).
32
+
33
+ Both screens persist their selection to `AsyncStorage`, so subsequent launches reconnect silently.
27
34
 
28
35
  ```tsx
29
36
  import { YaverFeedback, BlackBox, FeedbackModal } from 'yaver-feedback-react-native';
30
37
 
31
- // Initialize once at app startup
38
+ // Zero-config: no agentUrl, no authToken — the SDK handles auth + discovery.
32
39
  YaverFeedback.init({
33
- agentUrl: 'http://192.168.1.10:18080',
34
- authToken: 'your-sdk-token', // SDK token (recommended) or CLI token
35
40
  trigger: 'shake',
36
41
  });
37
42
 
38
- // Start Black Box flight recorder
43
+ // Start Black Box flight recorder once the user has signed in
39
44
  BlackBox.start();
40
45
  BlackBox.wrapConsole(); // opt-in: stream console.log/warn/error to the agent
41
46
 
42
- // Add FeedbackModal to your root component
47
+ // Add FeedbackModal to your root component — it embeds the login + picker UI.
43
48
  function App() {
44
49
  return (
45
50
  <>
@@ -50,7 +55,20 @@ function App() {
50
55
  }
51
56
  ```
52
57
 
53
- Shake your phone to open the feedback modal. Take screenshots, record voice notes, and send everything to your Yaver agent in one tap.
58
+ Shake your phone to open the feedback modal. Take screenshots, record voice notes, and send everything to your Yaver agent in one tap — LAN-direct when available, Convex/relay-routed when you're on cell data.
59
+
60
+ ### Opt-out: bring-your-own auth (pre-0.5 behavior)
61
+
62
+ If your app already authenticates against yaver.io on its own and just wants to pass a ready token:
63
+
64
+ ```tsx
65
+ YaverFeedback.init({
66
+ agentUrl: 'http://192.168.1.10:18080',
67
+ authToken: 'your-sdk-token', // SDK token (recommended) or CLI token
68
+ trigger: 'shake',
69
+ autoLogin: false, // don't show the in-app login flow
70
+ });
71
+ ```
54
72
 
55
73
  ## Authentication
56
74
 
@@ -62,7 +80,7 @@ SDK tokens are **long-lived (1 year)** and **independent from CLI session tokens
62
80
 
63
81
  ```bash
64
82
  # Create an SDK token
65
- yaver sdk-token create --label "AcmeStore dev"
83
+ yaver sdk-token create --label "BentoApp dev"
66
84
  # prints: 4a8f...b3c2
67
85
  ```
68
86
 
@@ -121,7 +139,7 @@ The SDK implements defense-in-depth with 6 security layers:
121
139
 
122
140
  ```bash
123
141
  # Default scopes (safe for embedding in app builds)
124
- yaver sdk-token create --label "AcmeStore"
142
+ yaver sdk-token create --label "BentoApp"
125
143
  # → scopes: feedback, blackbox, voice, builds
126
144
 
127
145
  # Narrow scopes (feedback only)
@@ -170,7 +188,7 @@ import { BlackBox } from 'yaver-feedback-react-native';
170
188
  BlackBox.start({
171
189
  flushInterval: 2000, // send buffered events every 2s (default)
172
190
  maxBufferSize: 50, // flush immediately at 50 events (default)
173
- appName: 'AcmeStore',
191
+ appName: 'BentoApp',
174
192
  });
175
193
 
176
194
  // Logging
@@ -259,7 +277,7 @@ YaverFeedback.init({
259
277
  });
260
278
 
261
279
  // Start BlackBox — this also connects the command channel
262
- BlackBox.start({ appName: 'AcmeStore' });
280
+ BlackBox.start({ appName: 'BentoApp' });
263
281
  ```
264
282
 
265
283
  ### Custom Command Handlers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaver-feedback-react-native",
3
- "version": "0.4.0",
3
+ "version": "0.5.2",
4
4
  "description": "Visual feedback SDK for Yaver — shake-to-report, screen recording, voice annotations for vibe coding",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -10,7 +10,7 @@
10
10
  "android/",
11
11
  "app.plugin.js"
12
12
  ],
13
- "license": "MIT",
13
+ "license": "Apache-2.0",
14
14
  "repository": {
15
15
  "type": "git",
16
16
  "url": "https://github.com/kivanccakmak/yaver.io",
@@ -22,20 +22,35 @@
22
22
  "@react-native-async-storage/async-storage": ">=1.17.0"
23
23
  },
24
24
  "peerDependenciesMeta": {
25
- "@expo/config-plugins": { "optional": true },
26
- "expo-constants": { "optional": true }
25
+ "@expo/config-plugins": {
26
+ "optional": true
27
+ },
28
+ "expo-constants": {
29
+ "optional": true
30
+ }
27
31
  },
28
32
  "devDependencies": {
29
33
  "jest": "^29.0.0",
30
34
  "@types/jest": "^29.0.0",
35
+ "ts-jest": "^29.1.0",
31
36
  "typescript": "^5.0.0"
32
37
  },
33
38
  "scripts": {
34
39
  "test": "jest"
35
40
  },
36
41
  "jest": {
37
- "preset": "react-native",
38
- "testPathPattern": "__tests__"
42
+ "preset": "ts-jest",
43
+ "testEnvironment": "node",
44
+ "testMatch": [
45
+ "**/src/__tests__/**/*.test.ts"
46
+ ]
39
47
  },
40
- "keywords": ["yaver", "feedback", "bug-report", "screen-recording", "vibe-coding", "react-native"]
48
+ "keywords": [
49
+ "yaver",
50
+ "feedback",
51
+ "bug-report",
52
+ "screen-recording",
53
+ "vibe-coding",
54
+ "react-native"
55
+ ]
41
56
  }
@@ -0,0 +1,97 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { DeviceEventEmitter, Modal } from 'react-native';
3
+ import { YaverLoginScreen } from './LoginScreen';
4
+ import { YaverMachinePickerScreen } from './MachinePickerScreen';
5
+ import { YaverFeedback } from './YaverFeedback';
6
+ import { getToken, RemoteDevice } from './auth';
7
+
8
+ /**
9
+ * Presentation layer for the SDK's auth + machine-picker modals.
10
+ *
11
+ * Mounts automatically inside `<FeedbackModal />`, so consumers of the SDK
12
+ * get in-app login with no extra wiring. It listens for events emitted by
13
+ * `YaverFeedback.showLogin()` / `showMachinePicker()`:
14
+ *
15
+ * yaverFeedback:startLogin → show login modal
16
+ * yaverFeedback:startMachinePicker → show machine picker
17
+ *
18
+ * The overlay closes itself once login/pick succeeds, then re-emits
19
+ * `yaverFeedback:startReport` so the user continues straight into the
20
+ * feedback flow they originally triggered.
21
+ */
22
+ export const AuthOverlay: React.FC = () => {
23
+ const [loginVisible, setLoginVisible] = useState(false);
24
+ const [pickerVisible, setPickerVisible] = useState(false);
25
+ const [token, setToken] = useState<string | null>(null);
26
+
27
+ useEffect(() => {
28
+ let mounted = true;
29
+ (async () => {
30
+ const cached = await getToken();
31
+ if (mounted && cached) setToken(cached);
32
+ })();
33
+
34
+ const loginSub = DeviceEventEmitter.addListener(
35
+ 'yaverFeedback:startLogin',
36
+ () => setLoginVisible(true),
37
+ );
38
+ const pickerSub = DeviceEventEmitter.addListener(
39
+ 'yaverFeedback:startMachinePicker',
40
+ async () => {
41
+ const cached = await getToken();
42
+ if (cached) setToken(cached);
43
+ if (cached) setPickerVisible(true);
44
+ },
45
+ );
46
+ return () => {
47
+ mounted = false;
48
+ loginSub.remove();
49
+ pickerSub.remove();
50
+ };
51
+ }, []);
52
+
53
+ const handleLoggedIn = async (newToken: string) => {
54
+ setToken(newToken);
55
+ await YaverFeedback.setAuthToken(newToken);
56
+ setLoginVisible(false);
57
+ setPickerVisible(true);
58
+ };
59
+
60
+ const handleDevicePicked = async (device: RemoteDevice) => {
61
+ await YaverFeedback.setPreferredDevice(device.deviceId);
62
+ setPickerVisible(false);
63
+ // Continue straight into the feedback flow the user originally triggered.
64
+ DeviceEventEmitter.emit('yaverFeedback:startReport');
65
+ };
66
+
67
+ return (
68
+ <>
69
+ <Modal
70
+ visible={loginVisible}
71
+ animationType="slide"
72
+ presentationStyle="fullScreen"
73
+ onRequestClose={() => setLoginVisible(false)}
74
+ >
75
+ <YaverLoginScreen
76
+ onLoggedIn={handleLoggedIn}
77
+ onCancel={() => setLoginVisible(false)}
78
+ />
79
+ </Modal>
80
+
81
+ <Modal
82
+ visible={pickerVisible && !!token}
83
+ animationType="slide"
84
+ presentationStyle="fullScreen"
85
+ onRequestClose={() => setPickerVisible(false)}
86
+ >
87
+ {token && (
88
+ <YaverMachinePickerScreen
89
+ token={token}
90
+ onPick={handleDevicePicked}
91
+ onCancel={() => setPickerVisible(false)}
92
+ />
93
+ )}
94
+ </Modal>
95
+ </>
96
+ );
97
+ };
package/src/BlackBox.ts CHANGED
@@ -7,7 +7,15 @@ import { YaverFeedback } from './YaverFeedback';
7
7
  * These mirror the Go BlackBoxEvent struct on the agent side.
8
8
  */
9
9
  export interface BlackBoxEvent {
10
- type: 'log' | 'error' | 'navigation' | 'lifecycle' | 'network' | 'state' | 'render';
10
+ type:
11
+ | 'log'
12
+ | 'error'
13
+ | 'navigation'
14
+ | 'lifecycle'
15
+ | 'network'
16
+ | 'state'
17
+ | 'render'
18
+ | 'track';
11
19
  level?: 'info' | 'warn' | 'error';
12
20
  message: string;
13
21
  timestamp: number;
@@ -94,7 +102,7 @@ export class BlackBox {
94
102
  }
95
103
 
96
104
  BlackBox.baseUrl = feedbackConfig.agentUrl.replace(/\/$/, '');
97
- BlackBox.authToken = feedbackConfig.authToken;
105
+ BlackBox.authToken = feedbackConfig.authToken ?? null;
98
106
  BlackBox.deviceId = config?.deviceId ?? BlackBox.generateDeviceId();
99
107
  BlackBox.appName = config?.appName ?? '';
100
108
  BlackBox.flushInterval = config?.flushInterval ?? 2000;
@@ -153,6 +161,37 @@ export class BlackBox {
153
161
  BlackBox.push({ type: 'log', level: 'error', message, timestamp: Date.now(), source, metadata });
154
162
  }
155
163
 
164
+ // ─── Track events ────────────────────────────────────────────────
165
+ //
166
+ // Business-event ingest. Routed into the agent's analytics ledger
167
+ // via the same BlackBox stream so the dev doesn't pay Mixpanel
168
+ // / Amplitude for "the user tapped Purchase." Zero dashboards in
169
+ // yaver; export to CSV / webhook into PostHog if you want charts.
170
+
171
+ /**
172
+ * Record a business event. Fires into the analytics ledger on
173
+ * the agent — see GET /analytics/events.csv.
174
+ *
175
+ * @example
176
+ * ```ts
177
+ * BlackBox.track('purchase_completed', {
178
+ * amount: '9.99',
179
+ * currency: 'USD',
180
+ * plan: 'pro',
181
+ * });
182
+ * ```
183
+ */
184
+ static track(name: string, props?: Record<string, unknown>, route?: string): void {
185
+ if (!name) return;
186
+ BlackBox.push({
187
+ type: 'track',
188
+ message: name,
189
+ timestamp: Date.now(),
190
+ route,
191
+ metadata: props,
192
+ });
193
+ }
194
+
156
195
  // ─── Errors ──────────────────────────────────────────────────────
157
196
 
158
197
  /** Record a caught error with stack trace. Also adds to the feedback error buffer. */
package/src/Discovery.ts CHANGED
@@ -1,13 +1,23 @@
1
- // AsyncStorage is an optional peer dep — gracefully degrade if missing
2
- let AsyncStorage: {
1
+ // AsyncStorage is an optional peer dep — gracefully degrade if missing.
2
+ // Resolved lazily on each call so unit-test mocks of
3
+ // `@react-native-async-storage/async-storage` are picked up even when
4
+ // Discovery.ts is imported before the mock is applied.
5
+ type AsyncStorageLike = {
3
6
  getItem: (key: string) => Promise<string | null>;
4
7
  setItem: (key: string, value: string) => Promise<void>;
5
8
  removeItem: (key: string) => Promise<void>;
6
- } | null = null;
7
- try {
8
- AsyncStorage = require('@react-native-async-storage/async-storage').default;
9
- } catch {
10
- // Not installed discovery caching disabled, auto-discovery still works
9
+ };
10
+ function getAsyncStorage(): AsyncStorageLike | null {
11
+ try {
12
+ const mod = require('@react-native-async-storage/async-storage');
13
+ const candidate = mod?.default ?? mod;
14
+ if (candidate && typeof candidate.getItem === 'function') {
15
+ return candidate as AsyncStorageLike;
16
+ }
17
+ return null;
18
+ } catch {
19
+ return null;
20
+ }
11
21
  }
12
22
 
13
23
  const STORAGE_KEY = 'yaver_feedback_agent';
@@ -304,9 +314,10 @@ export class YaverDiscovery {
304
314
 
305
315
  /** Get the cached agent connection from storage. */
306
316
  static async getStored(): Promise<{ url: string; hostname: string } | null> {
307
- if (!AsyncStorage) return null;
317
+ const storage = getAsyncStorage();
318
+ if (!storage) return null;
308
319
  try {
309
- const raw = await AsyncStorage.getItem(STORAGE_KEY);
320
+ const raw = await storage.getItem(STORAGE_KEY);
310
321
  if (!raw) return null;
311
322
  const parsed = JSON.parse(raw);
312
323
  if (parsed && typeof parsed.url === 'string') {
@@ -320,9 +331,10 @@ export class YaverDiscovery {
320
331
 
321
332
  /** Store a successful discovery result. */
322
333
  static async store(result: DiscoveryResult): Promise<void> {
323
- if (!AsyncStorage) return;
334
+ const storage = getAsyncStorage();
335
+ if (!storage) return;
324
336
  try {
325
- await AsyncStorage.setItem(
337
+ await storage.setItem(
326
338
  STORAGE_KEY,
327
339
  JSON.stringify({ url: result.url, hostname: result.hostname }),
328
340
  );
@@ -333,9 +345,10 @@ export class YaverDiscovery {
333
345
 
334
346
  /** Clear the stored agent connection. */
335
347
  static async clear(): Promise<void> {
336
- if (!AsyncStorage) return;
348
+ const storage = getAsyncStorage();
349
+ if (!storage) return;
337
350
  try {
338
- await AsyncStorage.removeItem(STORAGE_KEY);
351
+ await storage.removeItem(STORAGE_KEY);
339
352
  } catch {
340
353
  // Storage failure is non-fatal
341
354
  }
@@ -16,6 +16,7 @@ import { BlackBox } from './BlackBox';
16
16
  import { captureScreenshot, startAudioRecording, stopAudioRecording } from './capture';
17
17
  import { uploadFeedback } from './upload';
18
18
  import { TimelineEvent, DeviceInfo, FeedbackBundle, AgentCommentary } from './types';
19
+ import { AuthOverlay } from './AuthOverlay';
19
20
 
20
21
  type FeedbackMode = 'live' | 'narrated' | 'batch';
21
22
 
@@ -327,9 +328,13 @@ export const FeedbackModal: React.FC = () => {
327
328
  [],
328
329
  );
329
330
 
330
- if (!visible) return null;
331
-
331
+ // The AuthOverlay must stay mounted so it can respond to login / picker
332
+ // events even when the feedback modal itself isn't visible. The wrapping
333
+ // fragment keeps the original return shape intact for the modal branch.
332
334
  return (
335
+ <>
336
+ <AuthOverlay />
337
+ {visible && (
333
338
  <Modal
334
339
  visible={visible}
335
340
  animationType="slide"
@@ -474,6 +479,8 @@ export const FeedbackModal: React.FC = () => {
474
479
  </View>
475
480
  </View>
476
481
  </Modal>
482
+ )}
483
+ </>
477
484
  );
478
485
  };
479
486