> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Verified Credentials

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/javascript/reference/react-quickstart) to get started.
</Card>

## Introduction

In the physical world, we as people have numerous ways of identifying ourselves (a passport, driving license, or birth certificate, for example). They are each used in different contexts and can have different fields of information, but they share one defining characteristic: they are accepted as proof of identity and are called "physical credentials".

We have exactly the same need in the digital world, and for this reason, the concept of ["verified credentials"](https://en.wikipedia.org/wiki/Verifiable_credentials) was created. A Verified Credential (VC) is a way to represent a digital identity in a way that can be shared and verified by others. They can be digital representations of physical credentials (like a passport) or they can be entirely digital (like an email address).

Specific to Dynamic, verified credentials can map to things like oauth (i.e. Facebook and Google), email, blockchain wallets, passkeys and more (these are called "formats"). Each format has its own set of fields and information that can be shared. They also always have a "provider" which is the service that issued the credential (i.e. Google, Apple, Dynamic).

## Accessing Verified Credentials

As you probably already read in the [accessing users](/react/users/accessing-users) section, you can access verified credentials as part of the user profile, so once you have that it is as simple as accessing the `verifiedCredentials` array.

React provides access to verified credentials through the `useDynamicContext` hook, allowing you to access the user's verified credentials array.

```tsx React theme={"system"}
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';

const { user } = useDynamicContext();

const verifiedCredentialsArray = user?.verifiedCredentials;
```

## Verified Credential Structure

### Fields Applicable to All VCs

| Field                                   | Description                                                                                                                                                      |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                                      | Internal ID for this VC                                                                                                                                          |
| format: JwtVerifiedCredentialFormatEnum | \[Optional] - Type of VC, e.g., email. See [JwtVerifiedCredentialFormatEnum](/react/users/verified-credential#jwtverifiedcredentialformatenum) for more details. |
| publicIdentifier?                       | \[Optional] - Common way to reference the VC, e.g., email address for email VCs or the name of a user for Google VC.                                             |
| email?                                  | \[Optional] - Email associated with the VC.                                                                                                                      |

### Fields Specific to OAuth

| Field               | Description                                                                                                                                            |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| oauthProvider?      | \[Optional] - Social provider associated with the VC, e.g., Apple. See [ProviderEnum](/react/users/verified-credential#providerenum) for more details. |
| oauthAccountId?     | \[Optional] - ID associated with the social provider for the VC.                                                                                       |
| oauthDisplayName?   | \[Optional] - Display name associated with the social provider for the VC.                                                                             |
| oauthUsername?      | \[Optional] - Username associated with the social provider for the VC.                                                                                 |
| oauthEmails?        | \[Optional] - Emails associated with the social provider for the VC.                                                                                   |
| oauthAccountPhotos? | \[Optional] - Photos associated with the social provider for the VC.                                                                                   |
| refId?              | \[Optional] - If using OAuth, this is the embedded wallet ID associated with the social account.                                                       |
| previousUsers?      | \[Optional] - User IDs who were previously associated with the VC.                                                                                     |

### Fields Specific to Wallets

| Field             | Description                                                                                                                                                                           |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| walletName?       | \[Optional] - Wallet name associated with the VC.                                                                                                                                     |
| address?          | \[Optional] - Wallet address associated with the VC.                                                                                                                                  |
| chain?            | \[Optional] - Chain associated with the VC.                                                                                                                                           |
| walletProvider?   | \[Optional] - Type of wallet. See [WalletProviderEnum](/react/users/verified-credential#walletproviderenum) for more details.                                                         |
| walletProperties? | \[Optional] - Generally only used for embedded wallets. See [WalletProperties](/react/users/verified-credential#walletproperties) for more details.                                   |
| embeddedWalletId? | \[Optional] - ID of the embedded wallet associated with the VC.                                                                                                                       |
| nameService?      | \[Optional] - ENS data name and avatar URL, if one is associated with the wallet in the VC. See [NameServiceData](/react/users/verified-credential#nameservicedata) for more details. |
| signerRefId?      | \[Optional] - For smart contract wallets, this is the wallet ID of the signer for the SCW.                                                                                            |

### NameServiceData

| Field           | Description                                  |
| --------------- | -------------------------------------------- |
| avatar?: string | \[Optional] - avatar associated with the ens |
| name?: string   | \[Optional] - name associated with the ens   |

### WalletProviderEnum

'browserExtension' || 'custodialService' || 'walletConnect' || 'qrCode' || 'deepLink' || 'embeddedWallet' || 'smartContractWallet'

### WalletProperties

| Field                             | Description                                                        |
| --------------------------------- | ------------------------------------------------------------------ |
| isAuthenticatorAttached?: boolean | \[Optional] - is authenticator i.e. passkey attached to the wallet |

### JwtVerifiedCredentialFormatEnum

'blockchain' || 'email' || 'externalUser' || 'oauth' || 'passkey' || 'phoneNumber' || 'totp'

### ProviderEnum

'emailOnly' || 'magicLink' || 'apple' || 'bitbucket' || 'discord' || 'facebook' || 'github' || 'gitlab' || 'google' || 'instagram' || 'linkedin' || 'microsoft' || 'twitch' || 'twitter' || 'blocto' || 'banxa' || 'dynamic' || 'alchemy' || 'zerodev' || 'cryptoDotCom'
