# Email Authentication

The Prismon SDK provides seamless wallet authentication using Solana wallets. This guide explains how to authenticate users with solana wallets.

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* An API key from Prismon
* Prismon SDK installed and configured (see Getting Started).

### Authentication Flow <a href="#authentication-flow" id="authentication-flow"></a>

1. Call the Email Signup method from the initialized client.
2. Pass the user email and password to the sign up method.
3. Verify the user email with the verification method.
4. After verifcation, you can proceed to login

### Signup Method

```typescript
 const response = await client.users.signUpWithEmail({
        email: "USER_EMAIL",
        password: "USER_PASSWORD",
      })
```

#### Example Response

```typescript
{
  "succeeded": true,
  "message": "string"
  "userId": "string",
  "VerificationCode": "jwt-token",
}
```

### Verify Email Method

```typescript
const response = await client.users.verifyEmail({
        email: "USER_EMAIL",
        verificationCode: "USER_VERIFICATION_CODE",
      })
```

#### Example Response

```typescript
{
  "succeeded": true,
  "message": "string"
  "userId": "string",
  "VerificationCode": "jwt-token",
}
```

> Viola you have successfully registered a user on your dApp [🥳](https://emojidb.org/hooray-emojis)

#### Login Method

```typescript
const response = await client.users.loginWithEmail({
        email: "USER_EMAIL",
        password: "USER_PASSWORD",
      })
```

#### Example Response

```typescript
{
  "Succeeded": true,
  "Message": "string"
  "UserId": "string",
  "UserWallet": "jwt-token",
  "Token" "jwt"
}
```

Store the token using `client.setJwtToken(token)` for authenticated API calls.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lucky-israel.gitbook.io/prismon-docs/getting-started/publish-your-docs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
