# Where to write before/after hooks code?

**URL:** <https://forum.heroiclabs.com/t/where-to-write-before-after-hooks-code/3167>\
**Category:** Game Design\
**Tags:** getting-started, server-framework, typescript\
**Created:** [October 17, 2022, 7:23am UTC](https://forum.heroiclabs.com/t/where-to-write-before-after-hooks-code/3167 "2022-10-17T07:23:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shahariar\_Ashik](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Shahariar\_Ashik](https://forum.heroiclabs.com/u/Shahariar_Ashik)\
**Post date:** [October 17, 2022, 7:23am UTC](https://forum.heroiclabs.com/t/where-to-write-before-after-hooks-code/3167/1 "2022-10-17T07:23:16Z")

</div>

I have implemented a simple browser game using reactjs and nakama. Now I want to implement some before and after hooks in this project. I am not understanding where to write this before/after hooks code in this project?

---

<div class="post-metadata">

**Author:** ![mharis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mharis/32/969_2.png) [@mharis](https://forum.heroiclabs.com/u/mharis)\
**Post date:** [October 17, 2022, 10:17am UTC](https://forum.heroiclabs.com/t/where-to-write-before-after-hooks-code/3167/2 "2022-10-17T10:17:47Z")

</div>

Hi, before/after hooks are server-side feature so the question is: do you have some server-side code or are you running just base/vanilla nakama server?

If all of your game logic so far is client-side then I’d suggest readint up about writing server-side nakama modules: [Nakama: Introduction | Heroic Labs Documentation](https://heroiclabs.com/docs/nakama/server-framework/introduction/index.html) …and then specifically about hooks here: [Nakama: Using Hooks | Heroic Labs Documentation](https://heroiclabs.com/docs/nakama/guides/server-framework/using-hooks/)
