CodeAPI

WixRouterUser

An object that contains information about the current site visitor who is logged in.

Table of Contents

PROPERTIES

?
Store values associated with an object.
idGets the user's ID.
roleGets the user's role.

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.

Syntax

get id(): string
TYPE
?
The kind of data the property stores.
string

role

Gets the user's role.

Description

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.

Syntax

get role(): string
TYPE
?
The kind of data the property stores.
string