# Plugin can't retrieve SiteSetting configured in admin ui

**URL:** https://meta.discourse.org/t/plugin-cant-retrieve-sitesetting-configured-in-admin-ui/44008
**Category:** Development
**Created:** [May 10, 2016, 7:57pm UTC](https://meta.discourse.org/t/plugin-cant-retrieve-sitesetting-configured-in-admin-ui/44008 "2016-05-10T19:57:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![KevinGlinski](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kevinglinski/32/121802_2.png) [@KevinGlinski](https://meta.discourse.org/u/KevinGlinski)
#### Post date: [May 10, 2016, 7:57pm UTC](https://meta.discourse.org/t/plugin-cant-retrieve-sitesetting-configured-in-admin-ui/44008/1 "2016-05-10T19:57:52Z")

</div>

I have a new plugin which has custom settings. I’m able to get the settings to show up in the UI, but when i call SiteSetting.purecloud\_client\_id it returns back only the value that is set in the yml file and never the configured value set in the admin UI. I assume I have something out of place but can’t figure out what.

plugin code to get the setting:  
[https://github.com/MyPureCloud/devcenter-discourse-plugin/blob/master/auth/pure\_cloud\_employee\_authenticator.rb](https://github.com/MyPureCloud/devcenter-discourse-plugin/blob/master/auth/pure_cloud_employee_authenticator.rb)

purecloud\_employee\_client\_id returns ‘default’ and not the value configured in the ui

---

<div class="post-metadata">

### Author: ![KevinGlinski](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kevinglinski/32/121802_2.png) [@KevinGlinski](https://meta.discourse.org/u/KevinGlinski)
#### Post date: [May 11, 2016, 11:59am UTC](https://meta.discourse.org/t/plugin-cant-retrieve-sitesetting-configured-in-admin-ui/44008/2 "2016-05-11T11:59:57Z")

</div>

Seems to be a larger problem going on, if i remove all code from plugin.rb and just have  
`puts SiteSetting.purecloud_employee_client_id`

it fails with a _uninitialized constant SiteSetting (NameError)_ error

---

<div class="post-metadata">

### Author: ![KevinGlinski](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kevinglinski/32/121802_2.png) [@KevinGlinski](https://meta.discourse.org/u/KevinGlinski)
#### Post date: [May 12, 2016, 8:09pm UTC](https://meta.discourse.org/t/plugin-cant-retrieve-sitesetting-configured-in-admin-ui/44008/3 "2016-05-12T20:09:32Z")

</div>

i ended up moving my plugin to a private repo and stuck my id and secret in there 😔

---

<div class="post-metadata">

### Author: ![Sam\_Lyon](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Sam\_Lyon](https://meta.discourse.org/u/Sam_Lyon)
#### Post date: [April 5, 2018, 12:00am UTC](https://meta.discourse.org/t/plugin-cant-retrieve-sitesetting-configured-in-admin-ui/44008/4 "2018-04-05T00:00:34Z")

</div>

Generally speaking, is it possible to access SiteSetting from a plugin’s plugin.rb?  
We are looking at this as a way to initialize a whole set of custom settings programmatically..
