kotlin / jetpack compose
dev.nexauth:compose
build.gradle.kts
dependencies {
implementation("dev.nexauth:compose:0.1.0")
}Drop-in screen
LoginScreen.kt
NexAuthScreen(
auth = NexAuth("pk_live_..."),
methods = listOf("whatsapp", "google", "passkey"),
branding = NexBranding(
appName = "Acme Health",
logoRes = R.drawable.logo,
primaryColor = Color(0xFF7C6CFF),
securedBy = true,
),
onSuccess = { session -> nav.navigate("home") }
)NexOtpBox — animated input
custom
NexOtpBox(
length = 6,
smsRetriever = true, // SMS Retriever API + auto-read
style = NexOtpStyle.Outlined, // Outlined | Filled | Underline
animation = NexOtpAnim.Scale, // Scale | Shake | None
cursorColor = Color(0xFF7C6CFF),
onComplete = { code -> viewModel.verify(code) }
)Phone number hint
hint
// Credential Manager — phone number hint bottom sheet:
val phone = auth.hintPhoneNumber(activity) // suspend, nullable
phone?.let { auth.otp.send("whatsapp", it) }Session
session
val session = auth.sessionFlow.collectAsState().value
auth.signOut() // clears EncryptedSharedPrefs