# registerBeforeEvent and registerAfterEvent

**URL:** https://forum.heroiclabs.com/t/registerbeforeevent-and-registerafterevent/5943
**Category:** Runtime Framework
**Tags:** server-framework
**Created:** [January 17, 2025, 3:12pm UTC](https://forum.heroiclabs.com/t/registerbeforeevent-and-registerafterevent/5943 "2025-01-17T15:12:47Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)
#### Post date: [February 24, 2025, 4:28pm UTC](https://forum.heroiclabs.com/t/registerbeforeevent-and-registerafterevent/5943/9 "2025-02-24T16:28:00Z")

</div>

I think there’s some confusion.

> **[Events](https://heroiclabs.com/docs/nakama/concepts/events/#process-events)**
>
> Events are a powerful way to send data to the game server and create data to be processed in the background on the server. You can create and receive data which can be forwarded to 3rd-party services like Analytics, Ads, In-app Purchases, and more.

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/registerbeforeevent-and-registerafterevent/5943)._
