# Insert a glimmer component after first post

**URL:** <https://meta.discourse.org/t/insert-a-glimmer-component-after-first-post/303282>\
**Category:** Development\
**Created:** [April 10, 2024, 6:19pm UTC](https://meta.discourse.org/t/insert-a-glimmer-component-after-first-post/303282 "2024-04-10T18:19:56Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [April 16, 2024, 4:09pm UTC](https://meta.discourse.org/t/insert-a-glimmer-component-after-first-post/303282/10 "2024-04-16T16:09:30Z")

</div>

I knew it was stupid to pass the `currentUser`, but I couldn’t figure that out!

The other bit, in the unlikely event that anyone else finds this useful, is

```plaintext
import Service, { inject as service } from "@ember/service";

```

```javascript
import { hbs } from "ember-cli-htmlbars";
import { withPluginApi } from "discourse/lib/plugin-api";
import { registerWidgetShim } from "discourse/widgets/render-glimmer";

export default {
  name: "initialize-banner-widget",
  initialize(container) {
    registerWidgetShim(
      "geo-banner-widget",
      "div.widget-connector",
      hbs`<Banner/>`
    );

    withPluginApi("0.1", (api) => {
      api.decorateWidget("post:after", (helper) => {
        const currentUser = container.lookup("service:current-user");
        if(helper.widget.model.post_number === 1){
          return helper.attach("geo-banner-widget");
        }
      });
    });
  },
};

```

---

_[View the full topic](https://meta.discourse.org/t/insert-a-glimmer-component-after-first-post/303282)._
