Godot Version
Godot Engine v4.5.1
Question
Hello everyone,
We already have an existing frontend application and would like to integrate a Godot game into one of our pages.
Before going deeper, I just want to confirm:
-
Is it possible to run a Godot game inside an existing frontend (for example, a web page)?
-
Can the frontend communicate with the Godot game (for example, pass config or receive score updates)?
Any confirmation or high-level guidance would be helpful.
Thank you!
Godot can run with the compatibility renderer in browsers.
Godot can interface with javascript through the JavaScriptBridge object, and api’s through HTTPClient objects or HTTPRequest nodes.
2 Likes
Technically, it is posible to run the Godot Engine game inside an existing frontend web-page. It’s basically just an HTML Web game. There is option in the exporting game settings for that.
What do you mean by can the frontend communicate with the Godot Engine? If the game is integrated into web page then of course the user is able to communicate with the game (e.g. pressing keyboard keys and clicking the mouse). If you mean whether or not the Godot Engine game integrated into web page is able to communicate with the web page’s server then yes. There many ways for that. For example HTTPRequest node. You would setup some API call address for that in order for the server to pick up the sent data from the client and save it (e.g. scores).
I hope I’ve understood your question correctly.
Thank you both for the explanations — this has been very helpful.
I just want to confirm a few high-level points to make sure I’m understanding the correct approach:
1) Web export / index.html
My understanding is that when exporting a Godot project to Web, Godot automatically generates the required HTML file (along with WASM/PCK), rather than us creating index.html manually.
-
Is the typical approach to host those exported files and embed them into an existing website (for example via an iframe)?
-
If tighter integration is needed, is using a custom HTML shell the right way to control/modify the generated HTML?
2) Frontend ↔ Godot communication
By “communication,” I meant programmatic communication (not keyboard/mouse input).
- For passing configuration into the game and receiving score/game events back in the webpage, is
JavaScriptBridge the recommended approach for Web builds?
3) API / HTTP requests
-
For backend communication (saving scores, progress, etc.), is HTTPRequest (or HTTPClient) the standard way to make API calls from a Godot Web export?
-
Are there any browser-specific considerations (such as CORS) we should be aware of?
If there are any official documentation links or simple examples covering Web export, JavaScriptBridge, or HTTP/API calls, I’d really appreciate pointers.
Thanks again!