CDP Frontend SDK
    Preparing search index...

    Function useCurrentUser

    • Hook to access the currently authenticated user's information.

      Returns { currentUser: null | User }

      function UserProfile() {
      const { currentUser } = useCurrentUser();

      if (!currentUser) {
      return null;
      }

      return (
      <div>
      <h2>User Profile</h2>
      <p>User ID: {currentUser.userId}</p>
      <p>EVM Accounts: {currentUser.evmAccounts.join(", ")}</p>
      </div>
      );
      }