# A versioned API for client side plugins

**URL:** <https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [February 23, 2016, 7:20pm UTC](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051 "2016-02-23T19:20:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [February 23, 2016, 10:37pm UTC](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051/5 "2016-02-23T22:37:55Z")

</div>

> [@stevenpslade](#):
>
> Will you be updating the Beginner’s Guide to Creating Discourse Plugins?

It’s on my list to review it. I suspect most of the steps will stay the same but I will confirm.

> [@cpradio](#):
>
> previously I had initialize(container) so I could access siteSettings to enable/disable the showing of a toolbar button. In the new API, that seems to be via api.container, which is fine, but how do I do it with noApi?

You should use `api.container` in your new code, but you can just pass the `container` to your old code like this:

```plaintext
initialize(container) {
   withPluginApi('0.1', api => newCode(api), { noApi: () => oldCode(container) });
}

```

(I doubt I will ever remove `container` from `initialize` BTW. The `api` object just has it for convenience so you don’t have to pass it around).

---

_[View the full topic](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051)._
