User
Represents a user in Annotorious. Used to associate annotations, targets and bodies with specific user identities.
Examples
You can set the current user for an Annotorious instance using the setUser method. You should set a User right after initializing Annotorious, and any time the user login status in your application changes.
To get the current user, you can use the getUser method:
Annotation Attribution
Setting a user object is not required for Annotorious to work. But once a user is set, Annotorious will automatically insert the user data into any body or target that is created or modified.
Note: Annotorious uses user data exclusively for inserting it into the annotation. It neither provides any authentication functionality itself, nor interacts with a login system on your behalf. Authentication and authorization remains up to your application.
User Properties
id
- Type:
string
- Required
A unique identifier for the user. This is the only required field.
isGuest
- Type:
boolean
- Optional
Indicates whether the user is a guest or a registered user. This can be used to differentiate between authenticated users and temporary guests.
name
- Type:
string
- Optional
The display name of the user. Can be used in the UI to show who created an annotation.
avatar
- Type:
string
- Optional
A URL to the user’s avatar image. Can be used to display the user’s profile picture in the annotation UI.