Configuration
This page describes all available configuration options for initializeLedgerProvider.
Configuration options
{
devConfig?: {
stub?: {
base?: boolean; // Enable base stub mode for development (default: false)
account?: boolean; // Enable account stubbing (default: false)
device?: boolean; // Enable device stubbing (default: false)
web3Provider?: boolean; // Enable Web3 provider stubbing (default: false)
dAppConfig?: boolean; // Enable dApp config stubbing (default: false)
};
};
target?: HTMLElement; // Target element to mount UI (default: document.body)
floatingButtonPosition?: 'bottom-right' | 'bottom-left' | 'bottom-center' | 'top-right' | 'top-left' | 'top-center' | 'middle-right'; // Position of the floating button (default: 'bottom-right')
floatingButtonTarget?: HTMLElement | string; // Element or CSS selector to anchor the floating button to
dAppIdentifier?: string; // Your dApp identifier
apiKey?: string; // Your Ledger API key
loggerLevel?: string; // Log level: 'debug', 'info', 'warn', 'error' (default: 'info')
dmkConfig?: any; // Device Management Kit configuration (optional)
walletTransactionFeatures?: Array<'send' | 'receive' | 'swap' | 'buy' | 'earn' | 'sell'>; // Wallet action CTAs to display
}Parameter details
devConfig.stub
Toggles local stub modes so you can simulate accounts, devices, and Web3 flows during development.
For development and testing, you can enable stub mode:
const cleanup = initializeLedgerProvider({
devConfig: {
stub: {
base: true, // Enable base stub mode
account: true, // Mock account operations
device: true, // Mock device interactions
web3Provider: true, // Mock Web3 provider responses
dAppConfig: true, // Mock dApp configuration
},
},
dAppIdentifier: "my-dapp",
apiKey: "your-api-key",
});target
Target element to mount UI. Default is document.body.
Determines where the Ledger Wallet Provider UI mounts in your application.
floatingButtonPosition
Controls where the floating Ledger button appears on screen. Default is 'bottom-right'.
Available positions: 'bottom-right', 'bottom-left', 'bottom-center', 'top-right', 'top-left', 'top-center', 'middle-right'.
initializeLedgerProvider({
floatingButtonPosition: "bottom-left",
// ...
});floatingButtonTarget
An HTMLElement or CSS selector string. When provided, the floating button is rendered as a compact button inside the target element instead of being positioned on screen.
Use this to integrate the Ledger button into your own navigation bar, wallet panel, or sidebar.
// CSS selector
initializeLedgerProvider({
floatingButtonTarget: "#my-wallet-button-slot",
// ...
});
// HTMLElement reference
initializeLedgerProvider({
floatingButtonTarget: document.querySelector("#my-wallet-button-slot"),
// ...
});When floatingButtonTarget is set, floatingButtonPosition has no effect —
the button is placed inside your target element instead.
dAppIdentifier
Your dApp identifier. This lets Ledger validate the integration and enable remote services.
apiKey
Your Ledger API key. Required for production use.
loggerLevel
Log level: 'debug', 'info', 'warn', 'error'. Default is 'info'.
Adjusts log verbosity.
dmkConfig
Device Management Kit configuration (optional).
Passes Device Management Kit options when you need custom device policies.
walletTransactionFeatures
An optional array of wallet transaction features to display as action buttons in the side panel.
Available features:
'send'- Send crypto'receive'- Receive crypto'swap'- Swap tokens'buy'- Buy crypto'earn'- Earn rewards'sell'- Sell crypto
If no features are specified, the action buttons section will not be displayed.
Return value
The function returns a cleanup function to remove the provider and UI components.
const cleanup = initializeLedgerProvider({ /* options */ })
// Later, when unmounting:
cleanup()The cleanup function tears down the UI and event listeners if your app unmounts.