Anonymous users
Anonymous users are users with no password. They can perform all the actions a normal user can make, but their account only exists for the duration of the session.
Note
Using this API requires that the COLLAB_KEY
environment variable is set on the server. Read more here.
Logging in and creating an anonymous user is done through the same API, client.loginAnonymously
client.loginAnonymously(userName): Promise<User>
userName
(string) the username to give to the anonymous user.
Logs in or creates an anonymous user. If the user already has an anonymous session, they will be logged in. If they do not, a new user account will be created for them an a session will be set.
This function resolves to a User
object that you can use to manage documents.
note
The userName parameter is only used for creating an anonymous user. If the user already has a session, the original userName will be used.
note
The session information is encoded and set in local storage, so the account will only be accessible on the browser & domain they signed up on.