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

# useEvmKeyExportIframe

```ts theme={null}
function useEvmKeyExportIframe(options: UseKeyExportIframeOptions): UseKeyExportIframeResult;
```

A hook for creating a secure iframe to export EVM private keys.

This hook handles the communication with a secure iframe that safely
exports EVM private keys to the user's clipboard without exposing them to the
JavaScript context.

The iframe will be automatically cleaned up when the component unmounts
or when the session expires.

## Parameters

| Parameter | Type                                                                                                               | Description                                          |
| --------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------- |
| `options` | [`UseKeyExportIframeOptions`](/sdks/cdp-sdks-v2/frontend/@coinbase/cdp-hooks/Interfaces/UseKeyExportIframeOptions) | Configuration options for the EVM key export iframe. |

## Returns

[`UseKeyExportIframeResult`](/sdks/cdp-sdks-v2/frontend/@coinbase/cdp-hooks/Interfaces/UseKeyExportIframeResult)

An object containing the iframe status and control functions.

## Example

```tsx theme={null}
import { useEvmKeyExportIframe } from '@coinbase/cdp-hooks';
import { useRef } from 'react';

function EvmKeyExportButton() {
  const containerRef = useRef<HTMLDivElement>(null);
  const { status } = useEvmKeyExportIframe({
    address: "0x1234...",
    containerRef,
    label: "Copy Private Key",
  });

  return (
    <div>
      <p>Status: {status ?? 'initializing'}</p>
      <div ref={containerRef} />
    </div>
  );
}
```
