Search...
id
Gets the user's ID.
Description
The unique ID of the user.
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.
Type:
stringRead Only
Was this helpful?
Get the user from the router request
Copy Code
1export function myRouter_Router(request) {2 let user = request.user;3 let userId = user.id; // "f6q0fb32-b06r-469f-ag4d-9df89afkj5d9"4 let role = user.role; // "Admin"5}