Skip to content

createConfig

Wraps the createConfig that is exported from @aa-sdk/core to allow passing an additional argument, the configuration object for the Auth Components UI (the modal and AuthCard).

Import

import { createConfig } from "@account-kit/react";

Usage

import { sepolia } from "@account-kit/infra";
import { AlchemyAccountsUIConfig, createConfig } from "@account-kit/react";
import { QueryClient } from "@tanstack/react-query";
 
const uiConfig: AlchemyAccountsUIConfig = {
  illustrationStyle: "linear",
  auth: {
    sections: [[{ type: "email" }], [{ type: "passkey" }]],
    addPasskeyOnSignup: true,
  },
};
 
const config = createConfig(
  {
    rpcUrl: "/api/rpc",
    chain: sepolia,
    ssr: true,
  },
  uiConfig
);
 
export const queryClient = new QueryClient();

Parameters

props

CreateConfigProps for creating an alchemy account config

ui

AlchemyAccountsUIConfig (optional) configuration to use for the Auth Components UI

Returns

AlchemyAccountsConfigWithUI an alchemy account config object containing the core and client store, as well as the UI config