Add AI search to your Astro app
What is Astro
Astro is an all-in-one web framework for content-driven websites. With Inkeep, you can Add AI Search & Chat to your landing page, app, blog, or documentation site powered by Astro.
Get an API key
- Go to the Inkeep Dashboard
- Select your project under Projects
- Go to the Integrations tab
- Click on Create integration
- Select Web
- Provide a Name and URL (optional) for the integration
- Click on Create
- Click the Example < /> button to get your API key and view suggested settings
Copy and add the apiKey
, integrationId
and organizationId
to your environment variables:
Install the component library
Define React components
Install the @astrojs/react package to use React components:
Customize your settings
First, create a useInkeepSettings.ts
file that will contain a hook that returns configuration for our Inkeep component(s).
Below is an example with common customizations.
Define the component
Next, create an InkeepSearchBar.tsx
file for the Search Bar
component.
Use the component
Now use the InkeepSearchBar.tsx
component in your Astro based website.
Use the client:load
directive to load and hydrate the InkeepSearchBar.tsx
component immediately on page load.
For a full list of customizations, check out the Search Bar documentation.