role


rolestringRead-only

Gets the user's role.

Gets one of the following roles:

  • "Admin" — The owner of the site.
  • "Member" — A user who is logged in.
  • "Visitor" — A user who is not logged in.

Note: The APIs in WixRouterUser are only partially functional when previewing your site. View a published version of your site to see their complete functionality.

Get the user from the router request
JavaScript
export function myRouter_Router(request) { let user = request.user; let userId = user.id; // "f6q0fb32-b06r-469f-ag4d-9df89afkj5d9" let role = user.role; // "Admin" }
Did this help?