Skip to content

oauthWithPopup

Initiates an OAuth authentication flow in a popup window and returns the authenticated user.

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",
  },
});
 
const user = await client.oauthWithPopup({
  type: "oauth",
  authProviderId: "google",
  mode: "popup",
});

Parameters

args

Extract<AuthParams, { type: "oauth"; mode: "popup" }> The authentication parameters specifying OAuth type and popup mode

Returns

Promise<User> A promise that resolves to a User object containing the authenticated user information