Getting Started
Installation
npm install @verida/account-web-vault @verida/client-tsUsage
import { Network as NetworkClient } from '@verida/client-ts';
import { Network } from '@verida/types';
import { VaultAccount } from '@verida/account-web-vault';
const VERIDA_NETWORK = Network.BANKSIA; // BANKSIA (testnet) or MYRTLE (mainnet)
const CONTEXT_NAME = 'My Application: Context Name';
// Logo for your application, should be a 170x170 PNG file
const LOGO_URL = "https://assets.verida.io/verida_login_request_logo_170x170.png";
const account = new VaultAccount({
request: {
logoUrl: LOGO_URL,
// openURL: An optional URL that will open a browser on the user's mobile device
// after accepting the login request in the Verida Wallet mobile app
openURL: window.location.href,
},
// network: Indicates to the Wallet which network the identity should be on.
network: VERIDA_NETWORK,
});
const context = await NetworkClient.connect({
client: {
network: VERIDA_NETWORK,
},
account: account,
context: {
name: CONTEXT_NAME,
},
});
if (!context) {
console.log(
'User cancelled login attempt by closing the QR code modal or an unexpected error occurred'
);
}Configuration
Open URL
Last updated
Was this helpful?