Skip to main content
All Amplify SDK functions require initialization before use. Call initAmplifySDK() once at application startup.

initAmplifySDK()

Function Signature

Parameters

SDKInitOptions

Usage Examples

Basic Initialization

With Telemetry Disabled

With Debug Logging

With All Options

React Integration

Create a hook to initialize the SDK once and expose ready state:
Call the hook near the root of your app:

Behavior

  • Validates API key - Ensures key follows expected format
  • Pre-populates cache - Fetches vaults and assets during initialization
  • Configures telemetry - Sets up PostHog if enabled
  • Configures logging - Sets log level and optional custom logger
  • Idempotent - Multiple calls with same key are no-ops
  • Re-initialization - Different key clears cache and reconfigures

Error Handling

For advanced logging configuration, see Logging.