configure(apiKey:logLevel:) once at app startup before accessing shared. Accessing shared before configuring causes a fatalError.
When using an email OTP signer, observe isOTPRequired to know when to display an OTP input, then call submit(otp:) with the code the user enters.
Instance Properties
authClient
Standalone auth client for explicit OTP lifecycle management. SeeAuthClient.
authManager
Authentication manager for the email OTP flow. SeeCrossmintAuthManager.
crossmintService
Low-level Crossmint service for direct API access.crossmintWallets
Factory for creating and retrieving smart wallets. SeeCrossmintWallets.
isOTPRequired
Emitstrue when a pending transaction is waiting for the user to enter an email OTP.
isProductionEnvironment
Whether the SDK is running against the Crossmint production environment.Instance Methods
cancelTransaction()
Cancels the pending transaction waiting for an OTP.logout()
Invalidates the server-side refresh token, clears the local session, and resets OTP state.setJWT(_:)
Sets a JWT for authentication. Use this when authenticating with an externally obtained token rather than through the built-in OTP flow.Note: Unlike the TypeScript SDK’s synchronoussetJwt, this isasyncbecause it updates actor-isolated state onCrossmintAuthManager.
submit(otp:)
Provides the OTP entered by the user to unblock the pending transaction.Type Properties
shared
The configured SDK instance. Access after callingconfigure(apiKey:logLevel:).
Type Methods
configure(apiKey:logLevel:)
Configures the SDK. Must be called once before accessingshared.
Parameters
-
apiKey: A client API key (prefixed
ck_). -
logLevel: Controls SDK log verbosity. Defaults to
.error.

