Skip to content

useCurrentUser

The useCurrentUser hook allows you to access current authenticated user datas like name and email.

Usage

src/index.tsx
import { useCurrentUser } from '@vtex/sales-app'
const CurrentUser = () => {
const { name, email } = useCurrentUser()
return <div>Current User: {name} - {email}</div>
}

Parameters

The useCurrentUser hook does not receive any parameters.

Returns

The useCurrentUser hook returns an object with the following properties:

name

  • type string

email

  • type string

Extension Points

This hook is available in the following extension points:

  • menu.drawer-content

For a full list of available extension points, refer to the ExtensionPoints page.