> ## 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.

# getExternalServerKeyShares

> Retrieves external server key shares for wallet operations

## Function Signature

```typescript theme={"system"}
getExternalServerKeyShares(params: {
  accountAddress: string;
  walletMetadata: WalletMetadata;
  password?: string;
  backupInfo?: KeyShareBackupInfo;
}): Promise<ServerKeyShare[]>
```

## Description

Retrieves external server key shares for the wallet by recovering them from backup using the supplied password. Returns the recovered plaintext shares.

## Parameters

### Required Parameters

* **`accountAddress`** (`string`) - The wallet address (must include `0x` prefix). Must match `walletMetadata.accountAddress`.
* **`walletMetadata`** ([`WalletMetadata`](/node/reference/types/wallet-metadata)) - The cached metadata for this wallet

### Optional Parameters

* **`password`** (`string`) - Required if the wallet was created with `backUpToDynamic: true`
* **`backupInfo`** ([`KeyShareBackupInfo`](/node/reference/types/key-share-backup-info)) - Pre-resolved backup info; if omitted the SDK reads it from `walletMetadata`

## Returns

* **`Promise<ServerKeyShare[]>`** - Array of external server key shares

## Example

```typescript theme={"system"}
import { authenticatedEvmClient } from './client';

const evmClient = await authenticatedEvmClient();
const walletMetadata = JSON.parse(await redis.get(`wallet:${accountAddress}`));

const keyShares = await evmClient.getExternalServerKeyShares({
  accountAddress,
  walletMetadata,
  password: 'user-password',
});

console.log('Key shares retrieved:', keyShares.length);
```

## Error Handling

```typescript theme={"system"}
try {
  const keyShares = await evmClient.getExternalServerKeyShares({
    accountAddress: '0xYourWalletAddress',
  });
  console.log('Key shares retrieved successfully');
} catch (error) {
  console.error('Failed to retrieve key shares:', error);
}
```

## Related Functions

* [`signTransaction()`](/node/reference/evm/sign-transaction) - Sign a transaction using key shares
* [`signMessage()`](/node/reference/evm/sign-message) - Sign a message using key shares
