> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CrossmintAuthManager

> Kotlin Class

**Class**

```kotlin theme={null}
class CrossmintAuthManager
```

## Properties

| Property    | Type                | Description                                                                                  |
| ----------- | ------------------- | -------------------------------------------------------------------------------------------- |
| `authState` | `StateFlow<Result>` | The current authentication state, updated as the user signs in, out, or the token refreshes. |

## Functions

| Function                | Description                                                                       |
| ----------------------- | --------------------------------------------------------------------------------- |
| `authenticateWithToken` | Establishes a session directly from an existing AuthToken, skipping the OTP flow. |
| `getJWT`                | -                                                                                 |
| `logout`                | -                                                                                 |
| `sendOtp`               | Sends a one-time password to the given email to begin Crossmint-managed sign-in.  |
| `setJWT`                | -                                                                                 |
| `verifyOtp`             | Verifies the code the user received and establishes a session on success.         |

### authenticateWithToken

```kotlin theme={null}
suspend fun authenticateWithToken(token: Result): Result<Unit, Result>
```

Establishes a session directly from an existing AuthToken, skipping the OTP flow.

### getJWT

```kotlin theme={null}
open suspend fun getJWT(): String?
```

### logout

```kotlin theme={null}
open suspend fun logout()
```

### sendOtp

```kotlin theme={null}
suspend fun sendOtp(email: String): Result<Result, Result>
```

Sends a one-time password to the given email to begin Crossmint-managed sign-in.

### setJWT

```kotlin theme={null}
open fun setJWT(jwt: String)
```

### verifyOtp

```kotlin theme={null}
suspend fun verifyOtp(email: String, code: String): Result<Result, Result>
```

Verifies the code the user received and establishes a session on success.
