# Import the User class instead of using User

**URL:** <https://meta.discourse.org/t/import-the-user-class-instead-of-using-user/139586>\
**Category:** Development\
**Created:** [January 23, 2020, 10:52pm UTC](https://meta.discourse.org/t/import-the-user-class-instead-of-using-user/139586 "2020-01-23T22:52:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [January 23, 2020, 11:27pm UTC](https://meta.discourse.org/t/import-the-user-class-instead-of-using-user/139586/2 "2020-01-23T23:27:24Z")

</div>

Change

`var currentUser = Discourse.User.current();`

to

`var currentUser = api.getCurrentUser();`

---

_[View the full topic](https://meta.discourse.org/t/import-the-user-class-instead-of-using-user/139586)._
