# How to subscribe to events (topic created, topic closed, etc..)

**URL:** <https://meta.discourse.org/t/how-to-subscribe-to-events-topic-created-topic-closed-etc/116242>\
**Category:** Development\
**Created:** [April 29, 2019, 1:10pm UTC](https://meta.discourse.org/t/how-to-subscribe-to-events-topic-created-topic-closed-etc/116242 "2019-04-29T13:10:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)\
**Post date:** [August 1, 2019, 11:45pm UTC](https://meta.discourse.org/t/how-to-subscribe-to-events-topic-created-topic-closed-etc/116242/3 "2019-08-01T23:45:54Z")

</div>

What is the best way to find them? I’m searching for `onAppEvent` but that isn’t turning up much:

```plaintext
$ grep -r onAppEvent *
app/assets/javascripts/discourse/lib/plugin-api.js.es6: this.onAppEvent("page:changed", data => fn(data.url, data.title));
app/assets/javascripts/discourse/lib/plugin-api.js.es6: api.onAppEvent('inserted-custom-html', () => {
app/assets/javascripts/discourse/lib/plugin-api.js.es6: onAppEvent(name, fn) {
jsapp/lib/plugin-api.js.es6: this.onAppEvent("page:changed", data => fn(data.url, data.title));
jsapp/lib/plugin-api.js.es6: api.onAppEvent('inserted-custom-html', () => {
jsapp/lib/plugin-api.js.es6: onAppEvent(name, fn) {

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-subscribe-to-events-topic-created-topic-closed-etc/116242)._
