Skip to content
Alchemy Logo

getAccount

function getAccount<TAccount>(params, config): GetAccountResult<TAccount>;

Defined in: account-kit/core/src/actions/getAccount.ts:34

Retrieves the account of the specified type from the client store based on the provided configuration.

import { getAccount } from "@account-kit/core";
// see createConfig for more information on how to create a config
import { config } from "./config";
 
const { account, status } = getAccount(
  {
    type: "LightAccount",
  },
  config,
);

Type Parameter

TAccount extends SupportedAccountTypes

ParameterTypeDescription

params

GetAccountParams<TAccount>

The parameters containing the type of the account to retrieve

config

AlchemyAccountsConfig

The configuration containing the client store

GetAccountResult<TAccount>

The result which includes the account if found and its status

Was this page helpful?