strengthCheck
abstract suspend fun strengthCheck(request: IPasswordsStrengthCheckParameters): PasswordsStrengthCheckResponse
Checks the strength of a password and returns a score with actionable feedback. Calls the POST /sdk/v1/passwords/strength_check endpoint. Does not create a session.
Kotlin:
StytchConsumer.passwords.strengthCheck(
PasswordsStrengthCheckParameters(
password = "mypassword",
email = "user@example.com",
)
)Content copied to clipboard
iOS:
let params = PasswordsStrengthCheckParameters(password: "mypassword", email: "user@example.com")
let response = try await StytchConsumer.passwords.strengthCheck(params)Content copied to clipboard
React Native:
StytchConsumer.passwords.strengthCheck({ password: "mypassword", email: "user@example.com" })Content copied to clipboard
Return
PasswordsStrengthCheckResponse containing a strength score, breach detection result, and feedback.
Parameters
request
IPasswordsStrengthCheckParameters
password— The password to evaluate.email?— The user's email address, used to improve strength scoring by checking against personal information.
Throws
StytchError
if the request fails.
if the coroutine is cancelled.