Getting Started
Installation
npm install @selfxyz/mobile-sdk-alphaNative Modules Setup
Quick Start
Minimal Example
import React from 'react';
import { View } from 'react-native';
import {
SelfClientProvider,
createListenersMap,
type Adapters
} from '@selfxyz/mobile-sdk-alpha';
import { DocumentCameraScreen } from '@selfxyz/mobile-sdk-alpha/onboarding/document-camera-screen';
// Configure adapters (see selfclient-provider.md for details)
const adapters: Adapters = {
auth: {
getPrivateKey: async () => "your-private-key"
},
scanner: yourNFCScannerAdapter,
network: {
http: { fetch },
ws: { connect: (url) => new WebSocket(url) }
},
crypto: {
hash: async (data) => /* hash implementation */,
sign: async (data, keyRef) => /* signing implementation */
},
documents: yourDocumentStorageAdapter
};
// Configure event listeners for navigation
const listeners = createListenersMap();
const config = {};
function App() {
return (
<SelfClientProvider
config={config}
adapters={adapters}
listeners={listeners.map}
>
<View style={{ flex: 1 }}>
<DocumentCameraScreen
onBack={() => console.log('Go back')}
onSuccess={() => console.log('MRZ scan successful')}
/>
</View>
</SelfClientProvider>
);
}Next Steps
Important Notes
Last updated