Mobile SDK: NFC scanning through SelfClient (#1214)

This commit is contained in:
Leszek Stachowski
2025-10-08 16:03:02 +02:00
committed by GitHub
parent 5d63c60457
commit 8cbb7c252e
28 changed files with 661 additions and 428 deletions

View File

@@ -12,7 +12,7 @@ import {
SdkEvents,
SelfClientProvider as SDKSelfClientProvider,
type TrackEventParams,
webScannerShim,
webNFCScannerShim,
type WsConn,
} from '@selfxyz/mobile-sdk-alpha';
@@ -29,7 +29,7 @@ type GlobalCrypto = { crypto?: { subtle?: Crypto['subtle'] } };
* Provides a configured Self SDK client instance to all descendants.
*
* Adapters:
* - `webScannerShim` for basic MRZ/QR scanning stubs
* - `webNFCScannerShim` for basic NFC scanning stubs on web
* - `fetch`/`WebSocket` for network communication
* - Web Crypto hashing with a stub signer
*/
@@ -38,7 +38,7 @@ export const SelfClientProvider = ({ children }: PropsWithChildren) => {
const adapters: Adapters = useMemo(
() => ({
scanner:
Platform.OS === 'web' ? webScannerShim : reactNativeScannerAdapter,
Platform.OS === 'web' ? webNFCScannerShim : reactNativeScannerAdapter,
network: {
http: {
fetch: (input: RequestInfo, init?: RequestInit) => fetch(input, init),