
Algolia Search
Wire Algolia type-ahead search into a React or Next.js app with InstantSearch hooks, safe API keys, and tunable relevance patterns.
Overview
Algolia Search is an agent skill for the Build phase that implements Algolia indexing and React InstantSearch patterns with relevance tuning guidance.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill algolia-searchWhat is this skill?
- React InstantSearch with hooks: useSearchBox, useHits, useRefinementList, usePagination, useInstantSearch
- Search-only Algolia key pattern via NEXT_PUBLIC env vars and algoliasearch/lite client
- InstantSearch shell: Configure, SearchBox, Hits with customizable Hit components
- Documents indexing strategies and relevance tuning alongside UI patterns
- Source vibeship-spawner-skills (Apache 2.0), dated 2026-02-27 in frontmatter
- Documents 5 key InstantSearch hooks: useSearchBox, useHits, useRefinementList, usePagination, useInstantSearch
Adoption & trust: 590 installs on skills.sh; 40.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need production-grade site search in Next.js but keep mixing admin keys, stale index settings, or hook APIs from outdated InstantSearch docs.
Who is it for?
Indie SaaS or storefront builders adding Algolia to Next.js/React with faceted filters and typed hits.
Skip if: Static sites with no search index budget or teams standardizing on Postgres full-text only with no Algolia account.
When should I use this skill?
When implementing Algolia search, React InstantSearch, indexing strategies, or relevance tuning in a web app.
What do I get? / Deliverables
You ship a search client module, InstantSearch UI with hooks, and indexing/relevance practices that use search-only keys in the frontend.
- lib/algolia.ts search client module
- InstantSearch UI components with Hit rendering and Configure widgets
Recommended Skills
Journey fit
Canonical placement is Build because the skill delivers UI integration code and indexing strategies during product construction. Frontend subphase matches React InstantSearch components, Hit rendering, and client-side search UX—not backend-only REST design alone.
How it compares
Integration skill for Algolia + React InstantSearch, not a generic SQL or Elasticsearch setup guide.
Common Questions / FAQ
Who is algolia-search for?
Frontend-focused solo builders implementing Algolia in React or Next.js who want InstantSearch hooks and safe key handling out of the box.
When should I use algolia-search?
During Build frontend work when adding product or content search, type-ahead, facets, or tuning relevance on an Algolia index.
Is algolia-search safe to install?
Review the Security Audits panel here; never commit admin API keys—follow the skill’s search-only public key pattern and rotate keys if leaked.
SKILL.md
READMESKILL.md - Algolia Search
# Algolia Search Integration Expert patterns for Algolia search implementation, indexing strategies, React InstantSearch, and relevance tuning ## Patterns ### React InstantSearch with Hooks Modern React InstantSearch setup using hooks for type-ahead search. Uses react-instantsearch-hooks-web package with algoliasearch client. Widgets are components that can be customized with classnames. Key hooks: - useSearchBox: Search input handling - useHits: Access search results - useRefinementList: Facet filtering - usePagination: Result pagination - useInstantSearch: Full state access ### Code_example // lib/algolia.ts import algoliasearch from 'algoliasearch/lite'; export const searchClient = algoliasearch( process.env.NEXT_PUBLIC_ALGOLIA_APP_ID!, process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_KEY! // Search-only key! ); export const INDEX_NAME = 'products'; // components/Search.tsx 'use client'; import { InstantSearch, SearchBox, Hits, Configure } from 'react-instantsearch'; import { searchClient, INDEX_NAME } from '@/lib/algolia'; function Hit({ hit }: { hit: ProductHit }) { return ( <article> <h3>{hit.name}</h3> <p>{hit.description}</p> <span>${hit.price}</span> </article> ); } export function ProductSearch() { return ( <InstantSearch searchClient={searchClient} indexName={INDEX_NAME}> <Configure hitsPerPage={20} /> <SearchBox placeholder="Search products..." classNames={{ root: 'relative', input: 'w-full px-4 py-2 border rounded', }} /> <Hits hitComponent={Hit} /> </InstantSearch> ); } // Custom hook usage import { useSearchBox, useHits, useInstantSearch } from 'react-instantsearch'; function CustomSearch() { const { query, refine } = useSearchBox(); const { hits } = useHits<ProductHit>(); const { status } = useInstantSearch(); return ( <div> <input value={query} onChange={(e) => refine(e.target.value)} placeholder="Search..." /> {status === 'loading' && <p>Loading...</p>} <ul> {hits.map((hit) => ( <li key={hit.objectID}>{hit.name}</li> ))} </ul> </div> ); } ### Anti_patterns - Pattern: Using Admin API key in frontend code | Why: Admin key exposes full index control including deletion | Fix: Use search-only API key with restrictions - Pattern: Not using /lite client for frontend | Why: Full client includes unnecessary code for search | Fix: Import from algoliasearch/lite for smaller bundle ### References - https://www.algolia.com/doc/api-reference/widgets/react - https://www.algolia.com/doc/libraries/javascript/v5/methods/search/ ### Next.js Server-Side Rendering SSR integration for Next.js with react-instantsearch-nextjs package. Use <InstantSearchNext> instead of <InstantSearch> for SSR. Supports both Pages Router and App Router (experimental). Key considerations: - Set dynamic = 'force-dynamic' for fresh results - Handle URL synchronization with routing prop - Use getServerState for initial state ### Code_example // app/search/page.tsx import { InstantSearchNext } from 'react-instantsearch-nextjs'; import { searchClient, INDEX_NAME } from '@/lib/algolia'; import { SearchBox, Hits, RefinementList } from 'react-instantsearch'; // Force dynamic rendering for fresh search results export const dynamic = 'force-dynamic'; export default function SearchPage() { return ( <InstantSearchNext searchClient={searchClient} indexName={INDEX_NAME} routing={{ router: { cleanUrlOnDispose: false, }, }} > <div className="flex gap-8"> <aside className="w-64"> <h3>Categories</h3> <RefinementLi