User Hooks - Admin Components

Note: These hooks are available since Medusa v2.21.0.

The user hooks retrieve admin users from the Medusa backend, such as the user that created an order edit or the user assigned to a task.

Code
import { useUser } from "@medusajs/dashboard/hooks"

These hooks are built on TanStack Query. Use them in your widgets and UI routes.


useUser#

Retrieve a single admin user by its ID. Pass a query object as the second parameter to select the fields and relations to retrieve.

Code
const { user, isPending } = useUser("user_123")

Parameters#

Loading...
Note: This hook retrieves the user with the specified ID, not the currently authenticated user.

Returns#

Along with the following, the hook returns the rest of TanStack Query's useQuery result.

Loading...
Was this page helpful?
Ask Bloom
For assistance in your development, use Claude Code Plugins or Docs MCP server in Cursor, VSCode, etc...FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break
⇧↵