Skip to content

Commit 477d4a7

Browse files
authored
Merge pull request #348 from docknetwork/chore/issue-directly-to-cloud-wallet-docs
Add issue directly to cloud wallet docs.
2 parents bea0bf9 + e35ca54 commit 477d4a7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/cloud-wallet.md

+27
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,33 @@ const document = {
9999
await wallet.addDocument(document);
100100
```
101101

102+
### Issuing Credentials to Cloud Wallet
103+
104+
You can issue credentials directly to a cloud wallet using the Truvera Workspace/API. The credential will be automatically distributed to the holder's cloud wallet through the DIDComm protocol, eliminating the need for direct API calls or manual credential handling.
105+
106+
#### Important Requirement
107+
108+
For the DIDComm automatic distribution to work properly, the **subject ID of the credential must be set to the holder's DID** when issuing the credential. This enables the system to route the credential to the correct wallet.
109+
110+
#### Receiving Credentials in Cloud Wallet
111+
112+
After a credential has been issued to a holder's DID, the cloud wallet only needs to fetch and process DIDComm messages to receive it:
113+
114+
```ts
115+
import {createDIDProvider} from '@docknetwork/wallet-sdk-core/lib/did-provider';
116+
import {createMessageProvider} from '@docknetwork/wallet-sdk-core/lib/message-provider';
117+
118+
const didProvider = createDIDProvider({ wallet });
119+
120+
const messageProvider = createMessageProvider({
121+
wallet,
122+
didProvider,
123+
});
124+
125+
// This will process the messages for all the DIDs in the wallet
126+
await messageProvider.fetchMessages();
127+
await messageProvider.processDIDCommMessages();
128+
```
102129

103130
### Full Example
104131

0 commit comments

Comments
 (0)