Skip to content

preparePopupOauth

Prepares the config needed to use popup-based OAuth login. This must be called before calling .authenticate with params { type: "oauth", mode: "popup" }, and is recommended to be called on page load.

This method exists because browsers may prevent popups from opening unless triggered by user interaction, and so the OAuth config must already have been fetched at the time a user clicks a social login button.

Import

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

Usage

import { AlchemyWebSigner } from "@account-kit/signer";
 
const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});
 
await signer.preparePopupOauth();

Returns

Promise<OauthConfig> the config which must be loaded before using popup-based OAuth