Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatars example without sending name and pictures through Liveblocks server #605

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GuillaumeSalles
Copy link
Contributor

This example shows how to build avatars without sending any information related to the users through Liveblocks servers (except the user ids).

<main className="flex place-items-center place-content-center w-full h-screen select-none">
<div className="flex pl-3">
{users.slice(0, 3).map(({ connectionId, id }) => {
return <Avatar key={connectionId} userId={id} />;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avatar only takes a userId

// your own custom auth backend (if used). Useful for data that will not change
// during a session, like a User's name or avatar.
type UserMeta = {
id: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No info in UserMeta

const response = await authorize({
room: req.body.room,
secret: API_KEY,
userId: `id-${Math.floor(Math.random() * Object.keys(users).length)}`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No userInfo sent to authorize. Just a userId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant