The dashboard inside a client's admin page
On the left, a mock admin page for the imaginary coffee shop, with the Gaugemint dashboard framed in it. On the right, the code that does it.
- Orders
- Products
- Customers
- Analytics
- Settings
Analytics
export default async function EmbeddedAnalytics() {
if (!(await isAdmin())) notFound(); // your own admin check, first
const src = process.env.GAUGEMINT_EMBED_URL; // the embed address from Gaugemint
if (!src) return <p role="alert">GAUGEMINT_EMBED_URL is not set.</p>;
return (
<iframe src={src} title="Gaugemint stats" width="100%" height={720} loading="lazy"
style={{ border: 0, maxWidth: 1100 }} referrerPolicy="no-referrer" />
);
}
- On the site's page in Gaugemint, create a share link and list the origin of your admin page under Embed in another site.
- Put the embed address in
GAUGEMINT_EMBED_URLon your server. - Keep the page behind your own admin login. The address works for anyone who has it.
The menu on the left is a picture: its items go nowhere. Steps, an Express version, a key-based version and the security notes are in Embed stats in an admin page.