Fully automated. The CLI creates a LucentInit.astro component and
wires it into your main layout.
Install with the CLI
Pick Astro when prompted.
Manual setup
LucentInit component
src/components/LucentInit.astro:Render it from your main layout
src/layouts/Layout.astro:
Notes
- Astro runs
<script> tags in .astro components 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_KEY will be
undefined in the browser.
- If you use multiple layouts, include
<LucentInit /> in the one your
tracked pages extend — or put it in a shared base layout.