# Get a user object by username or id javascript

**URL:** <https://meta.discourse.org/t/get-a-user-object-by-username-or-id-javascript/95342>\
**Category:** Development\
**Created:** [August 21, 2018, 7:03pm UTC](https://meta.discourse.org/t/get-a-user-object-by-username-or-id-javascript/95342 "2018-08-21T19:03:43Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)\
**Post date:** [September 28, 2019, 7:29pm UTC](https://meta.discourse.org/t/get-a-user-object-by-username-or-id-javascript/95342/5 "2019-09-28T19:29:24Z")

</div>

I’m working on one of the bugs related to events plugin where the current implementation was relying on usernames. Even though its an edge case, the usernames can change which creates the need to be able to get a user by their `id`.

I think there should be a similar method in core to find a user by id.

Interested to know your thoughts on this.

---

_[View the full topic](https://meta.discourse.org/t/get-a-user-object-by-username-or-id-javascript/95342)._
