Convenience function for logging in with email.

Usage

import { logInWithEmail } from "@treasure-dev/tdk-core";

// const client = ...

const { user, tdk } = await logInWithEmail({
  client,
  email: "example@treasure.lol",
  verificationCode: "123456",
});

Props

client

TreasureConnectClient

apiUri

string | undefined

  • The TDK API URI to use for all HTTP requests.
  • Defaults to "https://tdk-api.treasure.lol".
  • Development environment value is "https://tdk-api.spellcaster.lol".

chainId

number | undefined

  • The chain ID to use for initial connection.
  • Defaults to 42161 (Arbitrum One).

email

string

  • Email address to use for login.

verificationCode

string

sessionOptions

SessionOptions | undefined

  • Options for creating user sessions, if using account abstraction.