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:
Properties
Property | Type | Default | Description |
---|---|---|---|
id | string | required | A unique identifier for the user. |
isGuest | boolean | Indicates whether the user is a guest or a registered user. This can be used to differentiate between authenticated users and temporary guests. | |
name | string | User display name. Can be to show who created an annotation in your UI. | |
avatar | string | URL to the user’s avatar image. Can be used to display a profile picture in the UI. |
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.