Skip to main content

getCurrentSwid

MaestroKit provides the getCurrentSwid 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 swid = await MaestroManager.shared.getCurrentSwid() {
print("Current Swid: \(swid)")
} else {
print("No authenticated swid found.")
}
}