Skip to main content

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.

The useExportPrivateKey hook returns a URL where the user can reauthenticate and view their private key. On React Native, you open this URL in the system browser or an in-app browser.

Integration

import { useExportPrivateKey, useWallet } from "@getpara/react-native-wallet";
import { Button, Alert, Linking } from "react-native";

export function ExportKeyButton() {
  const { data: wallet } = useWallet();
  const { exportPrivateKeyAsync, isPending } = useExportPrivateKey();

  const handleExport = async () => {
    try {
      const { url } = await exportPrivateKeyAsync({
        walletId: wallet?.id,
      });

      if (url) {
        const canOpen = await Linking.canOpenURL(url);
        if (canOpen) {
          await Linking.openURL(url);
        } else {
          Alert.alert("Error", "Unable to open export URL");
        }
      }
    } catch (err) {
      console.error("Failed to export private key:", err);
      Alert.alert("Error", "Failed to initiate private key export");
    }
  };

  return (
    <Button
      title={isPending ? "Loading..." : "Export Private Key"}
      onPress={handleExport}
      disabled={isPending || !wallet}
    />
  );
}
For a better user experience, consider using expo-web-browser or react-native-inappbrowser-reborn to open the export URL within your app instead of leaving it.

Limitations

Currently, private key export is available for embedded EVM, Cosmos, and Solana wallets. Unclaimed pregenerated wallets and guest mode wallets cannot be exported.
After a pregenerated wallet is claimed, it is no longer app-managed and can use the same export flow as other embedded wallets.
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, or self-host the tool from its open-source repo at getpara/solana-import.