Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Is it possible to embed the "Your Name" in the URL or somewhere else in the code? I would like to be able to assign the name of the person instead of them having to type it in. For example, if it could be part of the URL string that would work great. Thanks.

You must be logged in to vote

Replies: 1 comment

Comment options

On excalidraw.com, the collaboration username is stored in localStorage and there's no URL parameter to pre-set it.

From the source (excalidraw-app/collab/Collab.tsx):

username: importUsernameFromLocalStorage() || "",

If no username is saved, a random one is generated via @excalidraw/random-username.

For the hosted excalidraw.com app: There's no supported way to embed the username in the URL. You'd have to pre-set it in each user's localStorage (excalidraw-collab-username key) before they open the link — which isn't practical for shared links.

If you're self-hosting with the @excalidraw/excalidraw React component: You have full control. You can set collaborator names programmatically via the API:

const collaborators = new Map();
collaborators.set("user-socket-id", {
  username: "Assigned Name Here",
});
excalidrawAPI.updateScene({ collaborators });

And you can call collabAPI.setUsername("Name") to set the local user's name before joining a room.

So the answer depends on your setup:

  • excalidraw.com → not possible via URL
  • Self-hosted React component → fully configurable via setUsername() / updateScene()
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.