Hi,
I’m using PHPMaker 2026 and I want to load an npm package using the correct, recommended method.
Package: @n8n/chat
GitHub: https://github.com/n8n-io/chat
NPM: https://www.npmjs.com/package/@n8n/chat
The package has a simple entrypoint.
Currently, I can load it successfully only when using the CDN version, for example:
<link href="https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css" rel="stylesheet" />
<div id="n8n-chat" style="width:100%; height:100vh;"></div>
<script type="module">
import { createChat } from "https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js";
createChat({
webhookUrl: "MY_WEBHOOK_URL",
target: "#n8n-chat",
mode: "fullscreen"
});
</script>
This works perfectly inside a Custom File.
However, I want to load the package using PHPMaker’s built-in package system, not through external CDN links.
My question is:
What is the correct way to include and use this npm package inside a PHPMaker Custom File?
I just want to make sure I’m following the proper PHPMaker method.