New Project
Add fast, relevant search to your Next.js app with this Algolia starter. Deploy in one click from the Vercel Marketplace.
A minimal Next.js starter showing how to use Algolia with the Algolia integration on the Vercel Marketplace. Deploy it, seed the sample products, and you have a full search experience — search-as-you-type, highlighting, keyboard navigation (⌘K) — powered by SiteSearch components built on React InstantSearch.
Live demo: algolia-search-starter.vercel.app
Deploying this starter with the button below installs the Algolia integration on your new project. It provisions an Algolia app and injects the API keys as environment variables — no manual configuration needed.
After the first deploy, seed the sample data once:
git clone https://github.com/<your-account>/algolia-search-starter && cd algolia-search-starternpm installnpx vercel link # link to the project you just deployednpx vercel env pull .env.localnpm run seed # pushes data/products.json to the starter_products index
Reload your deployment — search is live.
The integration injects three environment variables into the Vercel project:
| Variable | Purpose | Browser-safe? |
|---|---|---|
ALGOLIA_APP_ID | Identifies your Algolia application | ✅ exposed as NEXT_PUBLIC_ALGOLIA_APP_ID |
ALGOLIA_SEARCH_API_KEY | Search-only key used by the frontend | ✅ exposed as NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY |
ALGOLIA_WRITE_API_KEY | Indexing key used by npm run seed | ❌ server-side only, never exposed |
The browser-safe values are mapped in next.config.ts via the env key.
The write key is deliberately not mapped.
app/page.tsx — landing page rendering the search experiencecomponents/search.tsx — SiteSearch component (algoliasearch lite client + react-instantsearch)data/products.json — 20 sample productsscripts/seed.mjs — idempotent seed script targeting the starter_products indexgit clone https://github.com/algolia/algolia-search-starter && cd algolia-search-starternpm installnpx vercel link # link to a Vercel project with the Algolia integration installednpx vercel env pull .env.localnpm run seed # idempotent - safe to re-runnpm run dev
Open http://localhost:3000 and hit ⌘K.