LedeWire SDK API Reference
    Preparing search index...

    Function localStorageAdapter

    • A TokenStorage adapter that persists tokens in localStorage.

      Tokens survive page reloads and browser restarts, which is convenient for sites where users expect persistent sessions.

      Security note: localStorage is accessible to any JavaScript on the same origin. Only use this adapter on sites you fully control and trust. The default in-memory storage is safer for high-security use cases.

      Parameters

      • Optionalkey: string

        The localStorage key used to store tokens. Defaults to 'lw:tokens'. Override this if you have multiple LedeWire integrations on the same origin.

      Returns TokenStorage

      import { init, localStorageAdapter } from '@ledewire/browser'

      const lw = init({
      apiKey: 'your_api_key',
      storage: localStorageAdapter(),
      })