Astro can host your marketing pages and an academy page, while Embedin delivers the course and its community. This guide adds the course to an Astro page without requiring a client-side framework.
1. Prepare the course
In Embedin, create a course, add modules and lessons, and publish the content you are ready to share. For a self-paced course, copy the embed script from course settings. For a cohort course, publish the cohort and copy its cohort-specific script from the Cohorts page. Website embeds are unavailable while Notion-only embedding is enabled.
In Allowed website domains, add the hostname of your Astro site, such as localhost for local testing and academy.example.com for production. Include separate preview hostnames as needed.
2. Create an Astro page
Create src/pages/academy.astro:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Academy</title>
</head>
<body>
<main>
<h1>Academy</h1>
<script is:inline type="module" data-courseid="YOUR_COURSE_ID" src="https://embed.embedin.com/course.js"></script>
</main>
</body>
</html>
Replace YOUR_COURSE_ID with the ID from your copied embed script. For a cohort, also include the data-cohortid attribute from that script. The is:inline directive leaves the external script and its attributes in the rendered page; the script creates a course container at that position. If you have an existing layout, you can place the main content inside it instead.
Run your Astro site and visit http://localhost:4321/academy (or your configured port).
3. Link to the course
Use a regular link, for example:
<a href="/academy" data-astro-reload>Open the academy</a>
data-astro-reload requests a full navigation when Astro's client-side navigation is enabled. This matters when returning to the course: the embed module initializes on document load and should not be relied on to reinitialize after a client-side page swap.
4. Enable Community
On the course's Layout page, choose a workspace layout that supports Community and enable Show community. Learners with access can create posts and comment without leaving the course. Read how the course community works for more detail.
Start with a welcome post, participation guidelines, and a question related to the first lesson. Decide who will respond and when.
5. Test before sharing
Open the page directly and through your link, then navigate away and return. Check desktop and mobile, sign-in, lesson access, and posting as an enrolled learner. Also check the experience for someone without access.
If the embed does not load, check that the course is published, the ID is correct, and the current hostname is allowed. Test the production and preview domains separately.









