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

<Tabs>
  <Tab title="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>

  <Tab title="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>
      );
    }
    ```
  </Tab>
</Tabs>

## 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](/javascript/reference/waas/checking-waas-wallet-account-type)
* [Checking if WaaS is enabled](/javascript/reference/waas/checking-if-waas-is-enabled)
* [Exporting WaaS Private Key](/javascript/reference/waas/exporting-waas-private-key)
* [Adding EVM Extensions](/javascript/reference/evm/adding-evm-extensions)
* [Adding Solana Extensions](/javascript/reference/solana/adding-solana-extensions)
