Install with the CLI
Manual setup
1
Environment variable
.env:2
LucentInit component
src/components/LucentInit.astro:3
Render it from your main layout
src/layouts/Layout.astro:Notes
- Astro runs
<script>tags in.astrocomponents on the client by default, which is exactly what the recorder needs. - The
PUBLIC_prefix is required by Astro to expose an env var to client scripts. Without it,import.meta.env.PUBLIC_LUCENT_PUBLIC_KEYwill beundefinedin the browser. - If you use multiple layouts, include
<LucentInit />in the one your tracked pages extend — or put it in a shared base layout.