User Module

The User Module provides user-related features in your Medusa and Node.js applications.

How to Use User Module's Service#

You can use the User Module's main service by resolving from the Medusa container the resource Modules.USER imported from @medusajs/framework/utils.

For example:


Features#

User Management#

Manage and store your users through Create, Read, Update, and Delete (CRUD) operations:

Code
1const user = await userModuleService.createUsers({2  email: "user@example.com",3  first_name: "John",4  last_name: "Smith",5})

Invite Users#

Invite users to join your store and manage those invites, with expiry and revalidation features.

Code
1const invite = await userModuleService.createInvites({2  email: "user2@example.com",3})4
5// refresh token later6await userModuleService.refreshInviteTokens([invite.id])

Configure User Module#

Refer to this documentation for details on the module's options.

Was this page helpful?
Edit this page