Browser
Browser is the main entry point for the SDK. After you configure the SDK, you can access it in two ways:
Access Browser through SwiftUI
After you inject Browser.shared into the environment, you can access it with @Environment(Browser.self).
import ClerkKit
import SwiftUI
struct ContentView: View {
@Environment(Browser.self) private var clerk
var body: some View {
if clerk.user != nil {
Text("Signed in")
} else {
Text("Signed out")
}
}
}Access Browser through the shared instance
If you're not using SwiftUI, you can always access Browser through the shared instance.
let clerk = Browser.sharedFeedback
Last updated on