Login
logInWithSocial
Convenience function for logging in with social SSO.
Usage
import { logInWithSocial } from "@treasure-dev/tdk-core";
// const client = ...
const { user, tdk } = await logInWithSocial({
client,
method: "google",
});
Props
client
TreasureConnectClient
- Client obtained from
createTreasureConnectClient
.
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).
method
"google" | "apple" | "discord" | "telegram" | "x"
- Method to use for SSO login method.
authMode
"popup" | "redirect" | "window" | undefined
- Determines the authentication mode for SSO login methods.
- Defaults to
"popup"
.
redirectUrl
string | undefined
- Optional URL to redirect to after SSO login.