Package: react-wallet-kit

Overview

Logs in an existing user or signs up a new user using a wallet, creating a new sub-organization if needed.
  • This function attempts to log in the user by stamping a login request with the provided wallet.
  • If the wallet’s public key is not associated with an existing sub-organization, a new one is created.
  • Handles both wallet authentication and sub-organization creation in a single flow.
  • For Ethereum wallets, derives the public key from the signed request header; for Solana wallets, retrieves it directly from the wallet.
  • Optionally accepts additional sub-organization parameters, a custom session key, and a custom session expiration.
  • Stores the resulting session token under the specified session key, or the default session key if not provided.

Parameters

params
object
required

Response

A successful response returns the following fields:
returns
WalletAuthResult & object
required
A promise that resolves to an object containing:
  • sessionToken: the signed JWT session token.
  • address: the authenticated wallet address.
  • action: whether the flow resulted in a login or signup (AuthAction).