Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Account.getAuthenticatedAddress()

Get the authenticated account address without fully loading the account.

Type: static

Signature

static getAuthenticatedAddress(apiKey: string): Address | null

Parameters

apiKey

Type: string

API key for JAW services. Used to scope the storage lookup.

Returns

Address | null - The account address if authenticated, or null if not authenticated.

Behavior

This is a synchronous method that checks the authentication state stored locally:

  1. Checks localStorage for stored authentication state
  2. Returns the address if found and valid
  3. Returns null if not authenticated

This method does not trigger WebAuthn or any network requests.

Example

import { Account } from '@jaw.id/core';
 
const address = Account.getAuthenticatedAddress('your-api-key');
 
if (address) {
  console.log('Authenticated as:', address);
} else {
  console.log('Not authenticated');
}

Use Cases

  • Check before restore - Verify authentication before calling Account.get()
  • Conditional UI - Show different UI based on authentication state
  • Quick status check - Get address without full account initialization

Related