initAmplifySDK() once at application startup.
Import
Usage
Parameters
SDKInitOptions
Return Type
Examples
- Basic
- With Options
- Custom Logger
Behavior
- Validates API key - Ensures key follows expected format (
pxl_...) - 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
Related
- Logging Guide - Configure logging levels
- Project Setup - SDK initialization patterns