Prerequisites

Before you begin, make sure you have set up your Privy app and obtained your app ID and client ID from the Privy Dashboard.
A properly set up app client is required for mobile apps and other non-web platforms to allow your app to interact with the Privy API. Please follow this guide to configure an app client.

Initializing Privy

Initialize a Privy instance with your application context and a PrivyConfig object:
private val privy: Privy =
   Privy.init(
       context = applicationContext, // be sure to only pass in Application context
       config = PrivyConfig(
           appId = "YOUR_APP_ID",
           appClientId = "YOUR_APP_CLIENT_ID",
           logLevel = PrivyLogLevel.VERBOSE
       )
   )

Configuration

The configuration fields for the PrivyConfig are:
appId
String
required
Your Privy application ID, which can be obtained from the Privy Developer Dashboard, under App Settings > Basics
appClientId
String
required
Your app client ID, which can be obtained from the Privy Developer Dashboard, under App Settings > Clients
logLevel
PrivyLogLevel
(Optional) Your preferred log level. If no log level is specified, it will default to PrivyLogLevel.NONE.
customAuthConfig
LoginWithCustomAuthConfig
(Optional) Only use this if you plan to use custom authentication. Find more information here.
Be sure to maintain a single instance of Privy across the lifetime of your application. Initializing multiple instances of Privy will result in unexpected errors.