Skip to content

Commit 9233065

Browse files
committed
docs: restore demo sample sections
1 parent b42f77d commit 9233065

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

.cursor/rules/mobile-sdk-migration.mdc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,27 @@ contextUsageNote: If this file is used to add in-context notes, include a single
113113
- Test signature verification
114114
- Test storage adapter integration
115115

116-
### 9. SDK Integration into App
116+
### 9. Sample Applications
117+
**Target Location**: `packages/mobile-sdk-alpha/samples/`
118+
**Testing Strategy**:
119+
- Create React Native demo with MRZ → proof flow
120+
- Create web demo with browser-based MRZ input
121+
- Test iOS `OpenPassport` URL scheme
122+
123+
### 10. SDK Integration into App
117124
**Migration Strategy**:
118125
- Replace existing modules with SDK imports
119126
- Update import paths throughout app
120127
- Validate all existing functionality works
121128
- Ensure no regression in app behavior
122129

130+
### 11. In-SDK Lightweight Demo
131+
**Target Location**: `packages/mobile-sdk-alpha/demo/`
132+
**Testing Strategy**:
133+
- Embedded React Native demo using MRZ → proof flow
134+
- Test theming hooks integration
135+
- Validate build and run instructions
136+
123137
## Testing Best Practices
124138

125139
### Test Data Management

packages/mobile-sdk-alpha/docs/MIGRATION_CHECKLIST.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,18 @@
5353
- Enforce CDN allowlist and Content-Length checks.
5454
- Stream hashing to avoid buffering large files.
5555

56-
## 9. Integrate SDK into `/app`
56+
## 9. Sample applications
57+
58+
- React Native and web demos showcasing core flows.
59+
- iOS `OpenPassport` URL scheme.
60+
61+
## 10. Integrate SDK into `/app`
5762

5863
- Consume `@selfxyz/mobile-sdk-alpha` inside the `app` workspace.
5964
- Replace MRZ modules with SDK adapters and wire processing helpers.
6065
- Validate builds and unit tests.
66+
67+
## 11. In-SDK lightweight demo
68+
69+
- Embedded React Native demo inside the SDK with theming hooks.
70+
- Provide build and run instructions.

packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,37 @@ yarn build
205205

206206
</details>
207207

208-
## 9. Integrate SDK into `/app`
208+
## 9. Sample applications
209+
210+
<details>
211+
<summary><strong>Add React Native sample</strong></summary>
212+
213+
1. Under `samples/react-native/`, scaffold a bare-bones app using Expo or React Native CLI.
214+
2. Demonstrate MRZ scanning and registration flow using SDK APIs.
215+
3. Include instructions in a `README.md`.
216+
217+
</details>
218+
219+
<details>
220+
<summary><strong>Add web sample</strong></summary>
221+
222+
1. Under `samples/web/`, set up a Vite/React project showing browser-based MRZ input and proof generation.
223+
2. Document setup and build steps.
224+
225+
</details>
226+
227+
<details>
228+
<summary><strong>Configure OpenPassport scheme</strong></summary>
229+
230+
1. In the React Native sample's iOS project, add URL type `OpenPassport` to `Info.plist`.
231+
2. Document Android intent filters (AndroidManifest.xml). Ensure scheme uniqueness and validate redirect origins to prevent hijacking.
232+
3. Choose a scheme unique to your app (e.g., using reverse-domain or app-identifier prefix).
233+
4. Detect and handle collisions (fallback checks, verify caller package/signature).
234+
5. Verify redirect domains and consider app-claimed links/Android App Links and iOS Universal Links for stronger security.
235+
236+
</details>
237+
238+
## 10. Integrate SDK into `/app`
209239

210240
<details>
211241
<summary><strong>Integrate SDK in /app</strong></summary>
@@ -216,3 +246,16 @@ yarn build
216246
4. Validate builds and unit tests in the `app` workspace.
217247

218248
</details>
249+
250+
## 11. In-SDK lightweight demo
251+
252+
<details>
253+
<summary><strong>Create embedded demo app</strong></summary>
254+
255+
1. Scaffold `demo/` under the SDK as a minimal React Native project.
256+
2. Use SDK APIs for MRZ → proof flow.
257+
3. Expose simple theming configuration.
258+
4. Add `demo/README.md` with build/run instructions.
259+
5. Add publishing guardrails: exclude `demo/` from npm and add a CI step to verify the published tarball contents.
260+
261+
</details>

0 commit comments

Comments
 (0)