Hi everyone,
We’re building an Admin UI Extension (block targeting admin.product-details.block.render) that needs to POST analytics events to our app’s own backend. Our app is built on the Node.js app template (not Remix) with Express.
First off, Is there a recommended approach to handle this flow (Admin UI Extn → Shopify Node App Template backend) for apps that were built on the node app template.
From the extension we call:
fetch("api/admin-block/events", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ eventName, eventProperties }),
});
On the backend (Express), we’ve set up:
-
A `
app.use("/api/admin-block", ...)` middleware that setsAccess-Control-Allow-Origin: https://extensions.shopifycdn.comon every response. -
A
app.options(…)handler to answer preflights.
We’re not seeing any logs in our backend from this request at all… Totally blank.
We’ve tried a bunch of things but nothing seemed to click.
Is there an official Node.js app template example for Admin UI Extension → backend communication, similar to the Remix authenticate.admin(request) + cors() helper?
Any help is appreciated, especially if you’ve gotten this working on the Node.js template!
Thanks in Advance,
Ishaan