Skip to content

Astro

  1. Install the package:

    Terminal window
    npm install aeo.js
  2. Add the integration to your Astro config:

    astro.config.mjs
    import { defineConfig } from 'astro/config';
    import { aeoAstroIntegration } from 'aeo.js/astro';
    export default defineConfig({
    site: 'https://mysite.com',
    integrations: [
    aeoAstroIntegration({
    title: 'My Site',
    description: 'A site optimized for AI discovery',
    url: 'https://mysite.com',
    }),
    ],
    });
  3. Build your site:

    Terminal window
    npm run build

The Astro integration:

  • Hooks into the Astro build pipeline via astro:build:done
  • Scans all rendered HTML pages for content extraction
  • Generates all AEO files in your output directory
  • Automatically injects the Human/AI widget
  • Persists the widget across View Transitions

Pass any AeoConfig options to the integration:

aeoAstroIntegration({
title: 'My Site',
url: 'https://mysite.com',
generators: {
robotsTxt: true,
llmsTxt: true,
sitemap: false, // Astro has its own sitemap
},
widget: {
position: 'bottom-left',
theme: {
accent: '#6366f1',
},
},
});