Skip to main content

getCurrentUserID

MaestroKit provides the getCurrentUserID function to retrieve the ID of the currently authenticated user. This asynchronous function returns an optional String containing the user ID if the user is authenticated, or nil if no user is currently authenticated.

Return TypeDescriptionExample
String?The ID of the currently authenticated user; nil if not available."user12345"

Code Example

Task {
if let userID = await MaestroManager.shared.getCurrentUserID() {
print("Current User ID: \(userID)")
} else {
print("No authenticated user found.")
}
}