# How to implement async event tracking in JS runtime without blocking RPC response?

**URL:** https://forum.heroiclabs.com/t/how-to-implement-async-event-tracking-in-js-runtime-without-blocking-rpc-response/6264
**Category:** Runtime Framework
**Created:** [June 13, 2025, 11:19am UTC](https://forum.heroiclabs.com/t/how-to-implement-async-event-tracking-in-js-runtime-without-blocking-rpc-response/6264 "2025-06-13T11:19:22Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![mengxin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mengxin/32/1879_2.png) [@mengxin](https://forum.heroiclabs.com/u/mengxin)
#### Post date: [June 13, 2025, 11:20am UTC](https://forum.heroiclabs.com/t/how-to-implement-async-event-tracking-in-js-runtime-without-blocking-rpc-response/6264/2 "2025-06-13T11:20:15Z")

</div>

base on this discussion:

> [@registerBeforeEvent and registerAfterEvent](https://forum.heroiclabs.com/t/registerbeforeevent-and-registerafterevent/5943/9):
>
> I think there’s some confusion. Emitting new events, can be done via the client API or the provided runtime functions (in any runtime). If you register before/after hooks, they will only fire if the REST API /v2/event path receives a new event to emit, they will not if you use the runtime function inside a custom RPC. To process events, you need to register a function that will fire asynchronously on emitted events. This function can only be registered in the Go runtime.

---

_[View the full topic](https://forum.heroiclabs.com/t/how-to-implement-async-event-tracking-in-js-runtime-without-blocking-rpc-response/6264)._
