# Moving away from Discourse.SiteSettings: An upgrading guide

**URL:** https://meta.discourse.org/t/moving-away-from-discourse-sitesettings-an-upgrading-guide/158977
**Category:** Development
**Created:** [July 27, 2020, 6:10pm UTC](https://meta.discourse.org/t/moving-away-from-discourse-sitesettings-an-upgrading-guide/158977 "2020-07-27T18:10:35Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [July 27, 2020, 6:10pm UTC](https://meta.discourse.org/t/moving-away-from-discourse-sitesettings-an-upgrading-guide/158977/1 "2020-07-27T18:10:35Z")

</div>

In the most recent releases of Discourse, we’ve completely removed `Discourse.SiteSettings` from the Javascript application. The only places you’ll find it are for backwards compatibility.

We’re doing this as part of our migration to [Ember CLI](https://meta.discourse.org/t/embercli-coming-to-a-discourse-near-you/143528), but also because it’s the right thing to do - `Discourse.XYZ` is essentially a global variable which means our dependencies are all over the place.

**If you are a plugin or theme developer and use `Discourse.SiteSettings` in your code, now is the time to start thinking of migrating away.**

### How to update your Javascript code:

- If your reference is an Controller, Route, Model, Component or Widget, you can use `this.siteSettings` instead.

- If your file is in an initializer, you can look up the site settings using the container parameter: `let siteSettings = container.lookup('site-settings:main');`

- If your file is a qunit test, you can use `this.siteSettings` but **NOTE** your test method will need to be a proper function and not an arrow function so that `this` is correct:

- If your code is in a helper, there is a new function `helperContext()` which you can import and use to get the site settings in your helper function. **Please only use this in actual helpers!**

- If you are embedding discourse code via a script tag, you can access site settings via the container:

I have not added Deprecation warnings to `Discourse.SiteSettings` yet because I think right now there would be too many warnings to be actually useful due to all the existing themes and plugins that have not been updated yet. Once a considerable amount of that code has been updated I’ll add the warnings to make them easier to catch.

---

_[View the full topic](https://meta.discourse.org/t/moving-away-from-discourse-sitesettings-an-upgrading-guide/158977)._
