# Get access to aurelia root container in decorators

**URL:** <https://discourse.aurelia.io/t/get-access-to-aurelia-root-container-in-decorators/3784>\
**Category:** vNext\
**Created:** [September 16, 2020, 1:16pm UTC](https://discourse.aurelia.io/t/get-access-to-aurelia-root-container-in-decorators/3784 "2020-09-16T13:16:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Sayan751](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sayan751/32/1861_2.png) [@Sayan751](https://discourse.aurelia.io/u/Sayan751)\
**Post date:** [September 16, 2020, 4:08pm UTC](https://discourse.aurelia.io/t/get-access-to-aurelia-root-container-in-decorators/3784/2 "2020-09-16T16:08:09Z")

</div>

Hi @vipinrt, that infra is there, but the API is not there yet for friendly public consumption. For example, it can be accessed like this:

```javascript
// if you are using the `aurelia` umbrella package

const aurelia = Aurelia.app(...);
const rootContainer = aurelia.container;

// if you are not using the said package
const aurelia = new Aurelia();
const rootContainer = aurelia.container;

```

Another way would be to grab the container instance while registering the plugin. [Typically](https://discourse.aurelia.io/t/aurelia-2-plugin-sample-or-docs/3770/4) the plugin configuration object has a `register(container: IContainer)` method. The container can be grabbed can cached there as well.

However, note that if you have multiple "root"s in you app, you can technically have multiple instances of `Aurelia` to hydrate the DOM. So in that sense, there is no one true “root” container.

Moreover, let me also point out here that the lack of API is not accident IMO. I believe there are better ways to do things in Au2, which is why the static API is bit sparse in Au2. IMO having static API is bit problematic for testing.

In that light, if you can be more specific about what you want to achieve, I am sure the community members can come up with way better ideas.

Have fun with Au2 🙂

---

_[View the full topic](https://discourse.aurelia.io/t/get-access-to-aurelia-root-container-in-decorators/3784)._
