# Install on Astro

> Add Kymo to an Astro site. Use is:inline so Astro does not bundle the tag and document.currentScript stays valid.

Canonical: https://kymo.in/docs/guides/astro
Last updated: 2026-07-21

Add the tag to a shared layout so it renders on every page.

## In your layout

Put it in the `<head>` of `src/layouts/Layout.astro` (or whatever your base layout is called):

```astro
<head>
  <script is:inline defer src="https://kymo.in/beat.js" data-site="yoursite.com"></script>
</head>
```

> **Warning:** Keep `is:inline`. Without it, Astro treats the tag as a module to bundle and process, which changes how it loads and can leave `document.currentScript` null — and `beat.js` needs `currentScript` to read its `data-site`. `is:inline` emits the tag verbatim.

## View transitions

If you use Astro's `<ViewTransitions />`, client navigations swap the DOM without a full reload. Kymo hooks `history.pushState`, so those navigations are counted. If you find a transition is missed, confirm the script is in the persistent `<head>`, not inside a swapped region.

Then [verify events arrive](https://kymo.in/docs/start/verify).
