# Exposing UE4 hooks to JS / browser

**URL:** <https://forums.unrealengine.com/t/exposing-ue4-hooks-to-js-browser/434900>\
**Category:** Platform & Builds\
**Tags:** HTML5, javascript, unreal-engine, web-browser, question\
**Created:** [October 2, 2018, 5:56pm UTC](https://forums.unrealengine.com/t/exposing-ue4-hooks-to-js-browser/434900 "2018-10-02T17:56:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WILDLAND-IA-DEV](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wildland-ia-dev/32/1018188_2.png) [@WILDLAND-IA-DEV](https://forums.unrealengine.com/u/WILDLAND-IA-DEV)\
**Post date:** [October 2, 2018, 5:56pm UTC](https://forums.unrealengine.com/t/exposing-ue4-hooks-to-js-browser/434900/1 "2018-10-02T17:56:18Z")

</div>

Hi, I’m wondering how to control in-game events via JavaScript in the browser on a HTML5 build.

A very simple example would be a React component like ` <button onClick={this.toggleLight}>` that would toggle a light on / off in UE.

Is this easily doable? If so, is there a guide that goes into more detail?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_32122478](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_32122478](https://forums.unrealengine.com/u/anonymous_user_32122478)\
**Post date:** [October 3, 2018, 12:19am UTC](https://forums.unrealengine.com/t/exposing-ue4-hooks-to-js-browser/434900/2 "2018-10-03T00:19:21Z")

</div>

Get Varest and use JSON, It’s not webhooks but it will allow you to send data to a server and get callbacks. Your onclick would be an ‘ingame’ click ie pressing a button in game, but the response would be from your web page.

 ![255445-ds.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/0/c/00c63e70dc185929a6718a37be9473bba50756f9.png)

---

<div class="post-metadata">

**Author:** ![WILDLAND-IA-DEV](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wildland-ia-dev/32/1018188_2.png) [@WILDLAND-IA-DEV](https://forums.unrealengine.com/u/WILDLAND-IA-DEV)\
**Post date:** [October 4, 2018, 1:00am UTC](https://forums.unrealengine.com/t/exposing-ue4-hooks-to-js-browser/434900/3 "2018-10-04T01:00:41Z")

</div>

Thank you I will look into it!
