Skip to content

getAuthDetails

Gets the current logged in user If a user has an ongoing session, it will use that session and try to authenticate

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",
    },
  },
});
 
// throws if not logged in
const user = await signer.getAuthDetails();

Returns

Promise<User> the current user