Skip to content

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

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

Usage

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
await client.oauthWithRedirect({
  type: "oauth",
  authProviderId: "google",
  mode: "redirect",
  redirectUrl: "/",
});

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