# Website embeds reference

> One loader script from your team's address defines custom elements such as continuum-courses and continuum-publication. They draw in a Shadow DOM, read your public catalogue without a key, and can be restyled with CSS custom properties and ::part(). No API key is involved.

Website embeds put live Continuum content on any page without a server or an API key: course and event cards, buy buttons, or a whole publication. Most people create them with the generator in **Settings > Website & API > Website embeds**; the help guide [How to add your courses or a publication to any website](https://continuumlearn.com/help/website-embeds) covers that. This page is the reference for developers.

## The loader

Add the loader once per page, then any number of elements:

```html
<script src="https://your-team.continuumlearn.com/embed.js" async></script>

<continuum-courses folder="12" layout="grid" columns="3" limit="6" show-price>
  <a href="https://your-team.continuumlearn.com/discover">Browse our courses</a>
</continuum-courses>
```

- The script comes from your team's own address, so no team id or key appears in the snippet.
- Elements draw inside a Shadow DOM: your page's CSS can't break them, and theirs can't leak into your page.
- Anything inside the element (like the link above) is the fallback shown when JavaScript doesn't run. The generator includes one.
- Embeds set no cookies and do no tracking.

## Elements

| Element | Shows | Attributes |
|---|---|---|
| `<continuum-courses>` | A grid or list of public courses | `folder`, `language`, `type` (`course`, `live` or `publication`), `limit`, `layout`, `columns`, `show-price`, `show-image`, `button-label`, `heading-level`, `target`, `lang` |
| `<continuum-course id="123">` | One course card | `id` (required), plus the display attributes above |
| `<continuum-events>` | Published events, with the next session date, number of sessions and price | `limit`, `layout`, `columns`, `show-price`, `show-image`, `button-label`, `heading-level`, `target`, `lang` |
| `<continuum-event id="123">` | One event card | `id` (required), plus the display attributes above |
| `<continuum-buy type="course" id="123">` | A buy button into checkout | `type` (`course`, `bundle` or `broadcast_product` for an event ticket), `id`, `event` (for an event ticket: the event's id, needed to show the ticket price), `label`, `return-url`, `show-price`, `target`, `lang` |
| `<continuum-publication id="123">` | A whole publication, with its sidebar and lesson navigation | `id` (required), `lesson`, `lang`, `follow-url` |

| Attribute | Values |
|---|---|
| `layout` | `grid` or `list`. |
| `columns` | For a grid: `2`, `3` or `4`. Leave it out for automatic columns. Columns drop on narrow screens. |
| `limit` | How many to show, up to 50. |
| `show-price`, `show-image` | Boolean attributes: present means on. |
| `heading-level` | `2` to `6`: the heading tag used for card titles, so headings stay in order on your page. |
| `target` | `_blank` to open links in a new tab. |
| `lang` | A language code, such as `cy`, for button labels and dates. |
| `return-url` | For a buy button: where to send the buyer after checkout. |
| `event` | For an event-ticket buy button (`type="broadcast_product"`): the id of the event the ticket belongs to. The button reads the ticket's price from that event, so without `event` a ticket button shows no price. |
| `lesson` | For a publication: the lesson to open first. |

Buy buttons, for example `<continuum-buy type="broadcast_product" id="5" event="34" show-price></continuum-buy>`:

- always use the team's accent colour (or `--continuum-accent`);
- with `type="course"`, link to checkout labelled **Buy now** when the course is for sale; when it isn't, they link to the course page labelled **View course** (or your `label`);
- with `show-price`, show the price for a course, and for an event ticket when `event` is set. Bundle buttons show no price.

Dates use the browser's formatting for the chosen language. A browser that has no date data for that language (Chromium has none for Welsh, for example) shows British English dates instead.

Only public courses and published events appear. A publication appears only when "Allow this publication to be embedded on other websites" is turned on in its settings.

## Styling

| Custom property | Changes |
|---|---|
| `--continuum-accent` | Button and accent colour (defaults to the team's brand colour) |
| `--continuum-radius` | Card corner radius |
| `--continuum-font` | Font family (defaults to your page's font) |
| `--continuum-card-bg` | Card background |

For deeper changes, style the named parts with `::part()`: `card`, `image`, `body`, `title`, `summary`, `price`, `meta`, `button`, `grid`, `empty` and `buy`.

```css
continuum-courses {
  --continuum-accent: #1d3557;
  --continuum-radius: 4px;
}
continuum-courses::part(title) {
  font-size: 1.125rem;
}
```

## Events

Elements dispatch DOM events that bubble out of the Shadow DOM:

| Event | `detail` | When |
|---|---|---|
| `continuum:load` | `{count}` for card elements; `{id, lesson_id}` for a publication | Content has been drawn. |
| `continuum:error` | `{message}` | The content couldn't be loaded. The fallback stays visible. |

```js
document.addEventListener('continuum:load', (e) => {
  console.log(e.target.tagName, e.detail);
});
```

## Data, caching and allowed websites

- Elements read the public, read-only endpoints under `/embed/v1/` on your team's address (`/courses`, `/courses/{id}`, `/events`, `/events/{id}`, `/publications/{id}`). They are meant for the elements, not as an API: use [API v2](https://continuumlearn.com/developers/getting-started) for integrations.
- Responses are cached for about five minutes, so a change can take that long to appear.
- An administrator can restrict embeds to named websites under **Allowed websites** on the Website & API page. When the list is empty, any website can show them.
- Links from an embed carry `utm_source=embed` and `utm_medium=` the host name of the page they were clicked on.

## Search engines

Embeds are added by JavaScript. Google renders it; many other crawlers and AI assistants don't, and see only the fallback. When search visibility matters, render the content on your server through the API instead, or use the WordPress plugin, which outputs HTML.

## Frequently asked questions

### Can an embed show a signed-in learner's courses?

No. Embeds are anonymous and set no cookies. To move a member from your site into their courses, use [sign-in links](https://continuumlearn.com/developers/sign-in-links) or single sign-on.

### Do embeds use my API key?

No. They read only public catalogue data, so there is nothing secret in the snippet.
