# How to get a user avatar from username?

**URL:** <https://meta.discourse.org/t/how-to-get-a-user-avatar-from-username/49763>\
**Category:** Development\
**Created:** [September 6, 2016, 4:39am UTC](https://meta.discourse.org/t/how-to-get-a-user-avatar-from-username/49763 "2016-09-06T04:39:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr8](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mr8](https://meta.discourse.org/u/mr8)\
**Post date:** [September 6, 2016, 4:39am UTC](https://meta.discourse.org/t/how-to-get-a-user-avatar-from-username/49763/1 "2016-09-06T04:39:55Z")

</div>

What’s the recommended way to get a user’s avatar from their username in a plugin?

I did find some reference to `lookupAvatar(username)` in quote.js.es6, but there doesn’t seem to be much out there regarding avatars.

---

<div class="post-metadata">

**Author:** ![mr8](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mr8](https://meta.discourse.org/u/mr8)\
**Post date:** [September 6, 2016, 11:54pm UTC](https://meta.discourse.org/t/how-to-get-a-user-avatar-from-username/49763/2 "2016-09-06T23:54:55Z")

</div>

ok, so I was able to get the avatars to work using:

```
const opts = helper.getOptions();

opts.lookupAvatar(username);

```

which works and will display the avatar in the post, but will freeze up the preview when composing a new post/reply.

Any help would be appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![Bolarinwa\_Balogun](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bolarinwa_balogun/32/138753_2.png) [@Bolarinwa\_Balogun](https://meta.discourse.org/u/Bolarinwa_Balogun)\
**Post date:** [February 26, 2018, 6:00am UTC](https://meta.discourse.org/t/how-to-get-a-user-avatar-from-username/49763/3 "2018-02-26T06:00:22Z")

</div>

How did you get helper?
