oauthWithRedirect

Redirects the user to the OAuth provider URL based on the provided arguments. This function will always reject after 1 second if the redirection does not occur.

Import

1import { AlchemySignerWebClient } from "@account-kit/signer";

Usage

1import { AlchemySignerWebClient } from "@account-kit/signer";
2
3const client = new AlchemySignerWebClient({
4 connection: {
5 apiKey: "your-api-key",
6 },
7 iframeConfig: {
8 iframeContainerId: "signer-iframe-container",
9 },
10});
11
12await client.oauthWithRedirect({
13 type: "oauth",
14 authProviderId: "google",
15 mode: "redirect",
16 redirectUrl: "/",
17});

Parameters

args

Extract<AuthParams, { type: "oauth"; mode: "redirect" }> The arguments required to obtain the OAuth provider URL

Returns

Promise<never> A promise that will never resolve, only reject if the redirection fails