In this article, we walk you through the process setting up the Verida Client SDK and guide you through the process of initializing and using the library in your applications.
You can interactively use the Verida client library in your browser using the Verida Web Sandbox.
Initialize a connection to the Verida network using a private key stored on the user’s mobile device using the Verida Wallet:
import{NetworkasNetworkClient}from'@verida/client-ts';import{Network}from'@verida/types';import{VaultAccount}from'@verida/account-web-vault';constVERIDA_NETWORK=Network.BANKSIA;// BANKSIA (testnet) or MYRTLE (mainnet)constCONTEXT_NAME='My Application Context Name';// The LOGO_URL should be a 170x170 PNG fileconstLOGO_URL="https://assets.verida.io/verida_login_request_logo_170x170.png";constaccount=newVaultAccount({logoUrl:LOGO_URL});constcontext=awaitNetworkClient.connect({client:{network:VERIDA_NETWORK,},account:account,context:{name:CONTEXT_NAME,},});
Note: Change Network.BANKSIA to Network.MYRTLE to use a mainnet network.
CONTEXT_NAME: A string representing your decentralized application. By convention prefix it with your company name. ie: Verida: My Application.
Learn more about different authentication methods.