# Users, presence and mentions

Source: https://mroffice.ai/en/developers/embed/users

user names the person as your product knows them: id (never shown), name, and optionally email, avatarUrl (https) and color. The other people in the document see the name, the picture and the colour (their cursors, avatars and comments carry them); the email is never shown to them — it is yours for the watermark and for notifying mentions.

```js
const editor = MROffice.open({
  container: "#editor",
  token: () => fetch("/mroffice-token").then((r) => r.text()),
  // "@" in a comment: your own directory (as ONLYOFFICE's onRequestUsers).
  onRequestUsers: async (query) => {
    const people = await fetch(`/api/people?q=${encodeURIComponent(query)}`).then((r) => r.json());
    return people.slice(0, 50).map((p) => ({ id: p.id, name: p.name, email: p.email, avatarUrl: p.avatar }));
  },
  // Who is in the document (no email: that is yours to show).
  onUsersChange: ({ users, self }) => renderAvatars(users.filter((u) => u.id !== self)),
  // A comment named people: notify them (your server also gets comment.mention).
  onMention: ({ mentioned, text }) => toast(`Notified ${mentioned.map((m) => m.name).join(", ")}`),
});
```

- Presence: onUsersChange({ users, self }) tells your page who is in the document (one entry a person, with their mode), as they join and leave; your server also receives user.joined and user.left.
- Mentions: typing @ in a comment asks your onRequestUsers(query) for your own people (as ONLYOFFICE's onRequestUsers); without it the people in the document are offered. MR Office keeps no list of your users.
- When a comment naming people is posted, your page gets onMention and your server the signed comment.mention event with the people's ids, names and emails: you send the notification (email, in-app), MR Office sends none.
