# Accessing custom user fields via JavaScript/plugin API

**URL:** <https://meta.discourse.org/t/accessing-custom-user-fields-via-javascript-plugin-api/239035>\
**Category:** Development\
**Created:** [September 14, 2022, 9:21pm UTC](https://meta.discourse.org/t/accessing-custom-user-fields-via-javascript-plugin-api/239035 "2022-09-14T21:21:57Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Karpfen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/karpfen/32/261352_2.png) [@Karpfen](https://meta.discourse.org/u/Karpfen)\
**Post date:** [September 16, 2022, 8:20pm UTC](https://meta.discourse.org/t/accessing-custom-user-fields-via-javascript-plugin-api/239035/3 "2022-09-16T20:20:37Z")

</div>

> That’s where the user fields that you add in the UX are (they are actually a special kind of `user_custom_field`

I see, that explains the variable naming. Thank you.

I think the `/u/user.json` endpoint only exposes public fields since it is publicly accessible. Due to the nature of the issue, i doubt people would want their NSFW preferences exposed on their user card. Thus i will look into using groups as a workaround first 😃

---

_[View the full topic](https://meta.discourse.org/t/accessing-custom-user-fields-via-javascript-plugin-api/239035)._
