Skip to main content

loginWithEmailPassword

Usage

Method for authenticating a user. This method includes both sign up and log in paths, as well as password recovery.

import { Marble } from "marble-sdk";

const marble = new Marble();
const response = await marble.auth.loginWithEmailPassword();
info

This method is blocking, which means it won't return until the user has finished the authentication process.

info

This method will show a modal to the user. If you want to customize the modal, you can check the [customization](../Premium Features/customization) section.

Return value

{
loginState: "SUCCESS" | "FAILURE" | "ABANDONED";
}

Configuration


email (optional)

The user's email address. If provided, the user's email address will be pre-populated in the modal. If not provided, the user will have to enter their email address in the popup modal.

await marble.auth.loginWithEmailPassword({
email: "theo@marblewallet.com",
});

showFundWalletOnSignup (optional)

If the flag is set, will show the funding view when the user is signing up after the wallet is created. The funding view will prompt the user to use the embedded fiat on-ramp.

await marble.auth.loginWithEmailPassword({
showFundWalletOnSignup: true,
});

Overview

The loginWithEmailPassword function will present a series of actions to the user, including:

  1. Logging In / Signing Up
  2. If signing up, saving a recovery key
  3. Waiting for the wallet generation