# ScriptContext through client scope does not return project, but does in Perspective

**URL:** <https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [August 2, 2022, 10:01pm UTC](https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604 "2022-08-02T22:01:11Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 3, 2022, 10:53pm UTC](https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604/12 "2022-08-03T22:53:49Z")

</div>

initializeScriptManager is called separately for every leaf project in the gateway, and for the gateway scripting project, to support scripts running **in the gateway**. Each call should get a customized instance if there is different behavior based on the project. Every script environment gets its own tree under `system.*`.

And no, your script module cannot be your RPC handler. That way lies madness.

Keep in mind that your gateway scripts are **not** called through the RPC handler–the RPC handler is only getting referenced if your Vision client or the designer **invoke** it.

---

_[View the full topic](https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604)._
