LedeWire SDK API Reference
    Preparing search index...

    Interface BrowserClientConfig

    Configuration options for the LedeWire browser client.

    interface BrowserClientConfig {
        apiKey: string;
        baseUrl?: string;
        onAuthExpired?: () => void;
        storage?: TokenStorage;
    }
    Index

    Properties

    apiKey: string

    LedeWire API key that identifies the store. Obtained from the LedeWire merchant dashboard.

    baseUrl?: string

    Override the API base URL. Defaults to https://api.ledewire.com.

    onAuthExpired?: () => void

    Called when the user's session expires and cannot be refreshed. Use this to show a re-authentication prompt.

    onAuthExpired: () => showLoginModal()
    
    storage?: TokenStorage

    Token storage adapter. Defaults to MemoryTokenStorage (in-memory, most secure).

    To persist sessions across page reloads, use the built-in localStorageAdapter:

    import { init, localStorageAdapter } from '@ledewire/browser'
    const lw = init({ apiKey: '...', storage: localStorageAdapter() })