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

# Key Export

### SDK Method

<Note>
  This method is currently only available through our [web](/embedded-wallets/sdk/client-side/javascript#revealevmprivatekey), [React Native](/embedded-wallets/sdk/client-side/react-native#revealevmprivatekey), and [Android](/embedded-wallets/sdk/client-side/android#revealprivatekey) SDKs. For all other SDKs, refer to our [Reveal Page](/embedded-wallets/wallets/features/key-export#reveal-page) section below.
</Note>

<Frame>
  <img src="https://mintcdn.com/magic-newton/mA7B4icGsHcK07ZQ/images/pk-reveal-updated.webp?fit=max&auto=format&n=mA7B4icGsHcK07ZQ&q=85&s=e667b35076c3eae1b66c38415a2191bb" alt="pk-reveal-updated" width="800" height="497" data-path="images/pk-reveal-updated.webp" />
</Frame>

You can use Magic's [`user.revealEVMPrivateKey`](/embedded-wallets/sdk/client-side/javascript#revealevmprivatekey) method to allow your users to view their EVM private keys. Implementing this method will allow your end users to back up their private keys or take them to another wallet. **Neither Magic nor the developer can see this key; only the end user can.**

<Warning>
  **Breaking Change**: As of SDK version 31.0.0 (JavaScript) and 32.0.0 (React Native), `revealPrivateKey()` has been renamed to `revealEVMPrivateKey()` for EVM chains. For non-EVM chains, use the specific extension's `revealPrivateKey()` method instead. The Android SDK continues to use `user.revealPrivateKey()`.
</Warning>

### Usage

Once you have verified the correct setup of the Magic SDK and successfully authenticated the user, the reveal private key modal can then be displayed by calling the appropriate method:

<Info>
  **Important**: Implementing this SDK method will allow your end users to access their private key. Be sure to read through this document carefully before implementing.
</Info>

#### EVM Chains (Web & React Native)

```javascript JavaScript icon=square-js theme={null}
import { Magic } from "magic-sdk";

const magic = new Magic('PUBLISHABLE_API_KEY');

try {
  await magic.user.revealEVMPrivateKey();
} catch {
  // Handle errors if required!
}
```

#### Non-EVM Chains (Blockchain Extensions)

For non-EVM chains, use the specific extension's `revealPrivateKey` method:

```javascript JavaScript icon=square-js theme={null}
import { Magic } from "magic-sdk";
import { SolanaExtension } from "@magic-ext/solana";
import { BitcoinExtension } from "@magic-ext/bitcoin";

const magic = new Magic('PUBLISHABLE_API_KEY', {
  extensions: [
    new SolanaExtension({ rpcUrl: 'SOLANA_RPC_NODE_URL' }),
    new BitcoinExtension({ rpcUrl: 'BITCOIN_RPC_NODE_URL', network: 'testnet' }),
  ],
});

// Reveal Solana private key
try {
  await magic.solana.revealPrivateKey();
} catch {
  // Handle errors if required!
}

// Reveal Bitcoin private key
try {
  await magic.bitcoin.revealPrivateKey();
} catch {
  // Handle errors if required!
}
```

#### Android SDK

The Android SDK continues to use the original method:

```kotlin Kotlin icon=android theme={null}
try {
    magic.user.revealPrivateKey()
} catch (e: Exception) {
    // Handle errors if required!
}
```
