A Verida Account maintains a public profile for every application context. The default basicProfile currently contains:
name - Name of the account
country - Country where the account owner lives
description - Text description / bio of the Verida account
avatar.uri - The URI of an avatar image. This is currently encoded as a URI that contains a base64 representation of the image. (In the future other ways of storing an image will be supported, beyond a uri)
This public profile is a datastore that anyone can read from, but only the owner can write to.
In order to make working with profiles easier, there are some helper methods in the Verida SDK that simplify fetching and updating a profile. These are documented below.
Open the public profile for any Verida Account and context combination using an instance of the client object.
For example, open a user’s public profile created in the Verida: Vault mobile application:
constdid='did:vda:polyamoy:0x6B2a1bE81ee770cbB4648801e343E135e8D2Aa6F';constprofileConnection=awaitclient.openPublicProfile(did,'Verida: Vault','basicProfile');constpublicProfile=awaitprofileConnection.getMany()console.log('Account name',publicProfile.name)console.log('Account country',publicProfile.country)// Example showing how to inject the avatar into a <img id="avatar-img"> tagconstelm=document.getElementById("#avatar-img")elm.src =publicProfile.avatar.uri