...
Library options
ssi-auth-lib
library shows QR for desktop browsers and Web-link button for mobile browsers to trigger the interaction. It has two options:Show QR/Web-link to trigger an interaction with QR initiation media selected.
Show QR/Web-link to trigger an interaction with QR initiation media selected and support SSI OAuth flow configured on the dashboard for this particular interaction.
Library can be included
<script src="<path_to_lib>/wl.js"></script>
or as npm library https://www.npmjs.com/package/ssi-auth-lib
npm install ssi-auth-lib –save
const ProofSpace = require(‘ssi-auth-lib’)
Usage
For the pure interaction without SSI OAuth flow
Code Block language typescript ProofSpace.WebLinker.start(elem, { serviceDid: <YOUR_SERVICE_DID>, interactionId: <YOUR_OAUTH_ACTION_ID>, instanceId: <YOUR_OAUTH_INSTANCE_ID>, size: 300 // size of QR code in pixels }).then(() => { console.log(‘QR Initialized’); });
For the interaction with SSI OAuth flow
Code Block language typescript ProofSpace.WebLinker.startWithSSIOAuth(elem, { clientId: <CLIENT_ID> serviceDid: <YOUR_SERVICE_DID>, interactionId: <YOUR_OAUTH_ACTION_ID>, instanceId: <YOUR_OAUTH_INSTANCE_ID>, size: 300 // size of QR code in pixels }).then((result) => { console.log(result.access_token); });
Find the “clientId” | To find the “clientId”:
The first line on the new page, will be “clientId.” | |
Find your “serviceDid” | To find the “serviceDid”:
The first line on the new page will be “Service Public DID.” | |
Find the “interactionId” | To find the “interactionId”:
| |
Find the “instanceId” | To find the “instanceId”:
|
...