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

# Export Private Key

> You can allow your users to export the private key for their wallets if they choose, letting them take custody over their assets..

## Integration Methods

<Tabs>
  <Tab title="React Hook">
    The `useExportPrivateKey` hook will automatically open a popup window where your user can reauthenticate their session and then view and copy the private key for one of their connected wallets.

    <Tip>
      The hook can only be used from within your app's `ParaProvider` context. By default, the key exported will be that for the currently selected wallet, available from the `useWallet` or `useWalletState` hooks.
    </Tip>

    <CodeGroup>
      ```tsx App.tsx theme={null}
      import { useExportPrivateKey, useWallet} from "@getpara/react-sdk";

      export function App() {
        const { data: activeWallet } = useWallet();
        const { mutate: exportPrivateKey, isPending } = useExportPrivateKey();

        return (
          <Button
            disabled={isPending}
            onClick={() => {
              exportPrivateKey({
                walletId: activeWallet?.id, // Optional
              });
            }}
          >
            Export Private Key
          </Button>
        );
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Core Method">
    If you are using a custom UI implementation or you would like to control how the portal URL is managed, you can use the client's `exportPrivateKey` method directly.

    <CodeGroup>
      ```tsx AppContent.tsx theme={null}
      import { useClient, useWallet} from "@getpara/react-sdk";

      export function App() {
        const para = useClient();
        const { data: activeWallet } = useWallet();
        const [isPending, setIsPending] = useState(false);

        return (
          <Button
            disabled={isPending}
            onClick={() => {
              setIsPending(true);
              para.exportPrivateKey({
                shouldOpenPopup: false,     // If false, only the URL is created and `popupWindow` will be undefined
                walletId: activeWallet?.id, // Optional
              })
                .then(({ url, popupWindow }) => {
                  // Do something with the URL and/or popupWindow
                })
                .catch((error) => {
                  console.error('Error exporting private key:', error);
                })
                .finally(() => {
                  setIsPending(false);
                })
            }}
          >
            Export Private Key
          </Button>
        );
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Limitations

Currently, private key export is available for embedded EVM, Cosmos, and Solana wallets. Unclaimed pregenerated wallets and guest mode wallets cannot be exported.

<Note>
  After a pregenerated wallet is claimed, it is no longer app-managed and can use the same export flow as other embedded wallets.
</Note>

<Tip>
  EVM and Cosmos wallets share a key scheme, so an exported key from either works on both chains. Solana wallets use a different scheme (ED25519), so an exported Solana key only works with Solana wallets — you can re-import it at [connect.getpara.com/import](https://connect.getpara.com/import), or self-host the tool from its open-source repo at [getpara/solana-import](https://github.com/getpara/solana-import).
</Tip>
