The Wallet SDK enables you to build an identity wallet inside your app and allows your users to receive, store, and manage verifiable credentials.
To use the wallet-sdk, all you need to do is wrap your app in a WalletSDKProvider
and start building your wallet.
The Truvera Mobile SDK supports:
- Devices that have Android 8.1 or higher and iOS 11 or higher.
- Minimum supported version of Node.js is 20.2.0
npm install @docknetwork/wallet-sdk-core
npm install @docknetwork/wallet-sdk-react-native
There are some scripts and additional dependencies required. Please check our examples folder for detailed steps.
The following example will create a wallet and allow the user to add credentials to it, displaying the count of documents added to the wallet.
Notice that all documents are accessible through the documents
object.
import {Box, Button, NativeBaseProvider, Text} from 'native-base';
import React, {useEffect} from 'react';
import {
WalletSDKProvider,
useWallet,
} from '@docknetwork/wallet-sdk-react-native/lib';
const WalletDetails = function () {
const {wallet, status, documents} = useWallet();
return (
<Box>
<Text>Wallet status: {status}</Text>
<Text>Wallet docs: {documents.length}</Text>
<Button onPress={() => wallet.addDocument({
name: 'my credential',
type: 'VerifiableCredential',
})}>
<Text>Add Credential</Text>
</Button>
</Box>
);
};
const App = () => {
return (
<NativeBaseProvider>
<WalletSDKProvider>
<Box p={8}>
<Text>Dock Wallet SDK Demo</Text>
<Text>Press on `add credential` button to create a new credential</Text>
</Box>
<WalletDetails />
</WalletSDKProvider>
</NativeBaseProvider>
);
};
export default App;
The Truvera Documentation Portal aggregates documentation for all components of the Truvera Platform. Documentation specific to the Wallet SDK is mirrored from the GitHub repository. Node package reference documentation is also published on GitHub.io.
For more details you should read the getting started guide.
The examples directory contains detailed examples for running the Truvera Wallet SDK on NodeJS, Web, and Flutter.