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

# Importing WaaS Private Key

Import an existing private key to create a new WaaS wallet account.

### Usage

> [tab] JavaScript
>
> ```javascript theme={"system"}
> import { importWaasPrivateKey } from '@dynamic-labs-sdk/client/waas';
>
> const importPrivateKey = async (privateKey) => {
>   await importWaasPrivateKey({
>     chain: 'EVM', // or other chains like 'SOL'
>     privateKey,
>     thresholdSignatureScheme, // default is TWO_OF_TWO, but you can choose other `ThresholdSignatureScheme` like TWO_OF_THREE
>   });
> };
> ```

> [tab] React
>
> ```tsx theme={"system"}
> import { importWaasPrivateKey } from '@dynamic-labs-sdk/client/waas';
> import { useState } from 'react';
>
> function ImportPrivateKeyForm() {
>   const [privateKey, setPrivateKey] = useState('');
>   const [status, setStatus] = useState('');
>
>   const handleImport = async () => {
>     await importWaasPrivateKey({
>       chain: 'EVM',
>       privateKey,
>     });
>     setStatus('Imported successfully');
>     setPrivateKey('');
>   };
>
>   return (
>     <div>
>       <input
>         type="password"
>         value={privateKey}
>         onChange={(e) => setPrivateKey(e.target.value)}
>         placeholder="Enter private key"
>       />
>       <button onClick={handleImport} disabled={!privateKey}>
>         Import
>       </button>
>       {status && <p>{status}</p>}
>     </div>
>   );
> }
> ```

## Error Handling

* If you didn't add the WaaS extension for the specified chain, it will throw a `NoWalletProviderFoundError`.

## Related functions

* [Checking WaaS Wallet Account Type](https://docs.dynamic.xyz/docs/javascript/reference/waas/checking-waas-wallet-account-type.md)
* [Checking if WaaS is enabled](https://docs.dynamic.xyz/docs/javascript/reference/waas/checking-if-waas-is-enabled.md)
* [Exporting WaaS Private Key](https://docs.dynamic.xyz/docs/javascript/reference/waas/exporting-waas-private-key.md)
* [Adding EVM Extensions](https://docs.dynamic.xyz/docs/javascript/reference/evm/adding-evm-extensions.md)
* [Adding Solana Extensions](https://docs.dynamic.xyz/docs/javascript/reference/solana/adding-solana-extensions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.