Skip to main content

Recommended: JavaScript SDK with React Hooks

For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.

Overview

The global wallet interface does not provide a way to export the wallet key. If you’d like users to be able to export their global wallet key, you can provide an easy interface for them to log into their wallet and export the key.
You should prompt the user to log in with exactly the same credentials as they use to log in to the global wallet.

Pre-requisites

  • Check the ‘default wallet version’ in the embedded wallet section of the dashboard
  • Ensure you are using the same environment ID as you do for your global wallet implementation.

Steps

Use the exportPrivateKey method
  1. Get the primary wallet
  1. Guard against no primary wallet or no embedded wallet
  1. Get the connector
For EVM, Solana, and Sui wallets, you can use the DynamicWaasEVMConnector, DynamicWaasSolanaConnector, and DynamicWaasSuiConnector respectively.
  1. Define the display container
  1. Export the private key

Full Example

Last modified on June 25, 2026