algolia-pack
Claude Code skill pack for Algolia (24 skills)
Installation
Open Claude Code and run this command:
/plugin install algolia-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
What It Does
> 24 production-ready Claude Code skills for Algolia search — real algoliasearch v5 API code, not templates.
Skills (24) plugin-local skills
Configure Algolia CI/CD: GitHub Actions for index validation, automated reindexing on deploy, and integration testing against real Algolia indices.
Algolia CI Integration
Overview
Set up CI/CD pipelines for Algolia: run integration tests against a test index, validate index settings before deploy, and trigger reindexing on release.
Prerequisites
- GitHub repository with Actions enabled
- Algolia App ID and Admin key (stored as GitHub secrets)
- npm/pnpm project with
algoliasearchv5
Instructions
Examples
The workflow definitions below show the complete test, validation, and release-triggered reindex paths. Adapt only the index names and secret names to your repository; keep the test index isolated from production.
Step 1: Store Algolia Secrets
gh secret set ALGOLIA_APP_ID --body "YourApplicationID"
gh secret set ALGOLIA_ADMIN_KEY --body "your_admin_api_key"
gh secret set ALGOLIA_SEARCH_KEY --body "your_search_only_key"
Step 2: GitHub Actions — Test & Validate
# .github/workflows/algolia-ci.yml
name: Algolia CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Unit tests (mocked Algolia)
run: npm test
- name: Integration tests (real Algolia)
if: env.ALGOLIA_APP_ID != ''
run: npm run test:integration
env:
# Use timestamped index to avoid cross-PR collision
ALGOLIA_TEST_INDEX: ci_test_${{ github.run_id }}_products
validate-settings:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20', cache: 'npm' }
- run: npm ci
- name: Validate index settings match config
run: npx tsx scripts/validate-algolia-settings.ts
Step 3: Index Settings Validation Script
// scripts/validate-algolia-settings.ts
import { algoliasearch } from 'algoliasearch';
import expectedSettings from '../config/algolia-settings.json' assert { type: 'json' };
const client = algoliasearch(process.env.ALGOLIA_APP_ID!, process.env.ALGOLIA_ADMIN_KEY!);
async function validateSettings() {
const actual = await client.getSettings({ indexName: 'products' });
const errors: string[] = [];
// Check critical settings match
const checks: [string, any, any][] = [
['searchableAttributesDiagnose and fix the top Algolia API errors: 400, 403, 404, 429, ApiError, RetryError, and indexing failures.
Algolia Common Errors
Overview
Quick reference for the most common Algolia errors, their root causes, and fixes. All examples use algoliasearch v5 client error types.
Prerequisites
- The Algolia application ID and the least-privileged API key needed for the failing operation.
curl,jq, and the relevant application runtime available where you run diagnostics.- A safe test index when reproducing write failures; do not investigate against production with an unrestricted Admin key.
Instructions
Match the exact response status and request ID to the reference below, run the diagnostic script only with scoped credentials, then apply the smallest listed corrective action before retrying.
Error Handling
1. Invalid Application-ID or API key (403)
ApiError: Invalid Application-ID or API key
Cause: App ID or API key is wrong, expired, or deleted.
Fix:
# Verify your env vars are set
echo "APP_ID: $ALGOLIA_APP_ID"
echo "KEY set: ${ALGOLIA_ADMIN_KEY:+yes}"
# Test with curl
curl -s "https://${ALGOLIA_APP_ID}-dsn.algolia.net/1/indexes" \
-H "X-Algolia-Application-Id: ${ALGOLIA_APP_ID}" \
-H "X-Algolia-API-Key: ${ALGOLIA_ADMIN_KEY}" | head -c 200
Get fresh keys: dashboard.algolia.com > Settings > API Keys.
2. Method not allowed with this API key (403)
ApiError: Method not allowed with this API key
Cause: Using a Search-Only key for a write operation (saveObjects, setSettings, etc.).
Fix: Use the Admin API key for write operations. Search-Only keys only permit search ACL.
// Wrong: search-only key for indexing
const client = algoliasearch(appId, searchOnlyKey);
await client.saveObjects({ ... }); // 403
// Right: admin key for indexing
const client = algoliasearch(appId, adminKey);
await client.saveObjects({ ... }); // Works
3. Index does not exist (404)
ApiError: Index products_staging does not exist
Cause: Searching an index that hasn't been created yet. Algolia creates indices lazily on first saveObjects.
Fix: Index some data first, or check the index name for typos:
# List all indices in your app
curl -s "https://${ALGOLIA_APP_ID}-dsn.algolia.net/1/indexes" \
-H "X-Algolia-Application-Id: ${ALGOLIA_APP_ID}" \
-H "X-Algolia-API-Key: ${ALGOLIA_ADMIN_KEY}" | jq '.items[].name'
4. Rate limit exceeded (429)
ApiError: Too Many Requests
Cause: API key'
Implement Algolia search with filters, facets, highlighting, and pagination.
Algolia Core Workflow A — Search & Filtering
Overview
Primary Algolia workflow: full-text search with filters, faceted navigation, hit highlighting, and pagination. Uses searchSingleIndex (v5) with real Algolia search parameters.
Prerequisites
- Completed
algolia-install-authandalgolia-hello-worldsetup - Index populated with records (see
algolia-hello-world) - Index settings configured with
searchableAttributesandattributesForFaceting
Instructions
Step 1: Configure Index for Filtering
import { algoliasearch } from 'algoliasearch';
const client = algoliasearch(process.env.ALGOLIA_APP_ID!, process.env.ALGOLIA_ADMIN_KEY!);
await client.setSettings({
indexName: 'products',
indexSettings: {
// What to search (ordered = priority matters)
searchableAttributes: ['name', 'description', 'brand', 'category'],
// What to filter/facet on — prefix with filterOnly() if no facet counts needed
attributesForFaceting: [
'searchable(brand)', // Searchable facet: users can search within brand values
'category', // Regular facet: shown in facet panels
'filterOnly(price)', // Filter only: no counts computed, saves CPU
'filterOnly(in_stock)',
],
// Custom ranking: tie-breaker after Algolia's relevance ranking
customRanking: ['desc(sales_count)', 'desc(rating)'],
// What comes back in hits
attributesToRetrieve: ['name', 'brand', 'price', 'image_url', 'category'],
attributesToHighlight: ['name', 'description'],
attributesToSnippet: ['description:30'], // 30-word snippet
},
});
Step 2: Search with Filters
// Algolia filter syntax uses SQL-like expressions
const { hits, nbHits, facets } = await client.searchSingleIndex({
indexName: 'products',
searchParams: {
query: 'running shoes',
// Numeric/boolean/string filters
filters: 'price < 150 AND in_stock = true',
// OR: facetFilters for UI-driven filtering (array = OR, nested = AND)
// facetFilters: [['category:shoes', 'category:sneakers'], ['brand:Nike']],
// ^ shoes OR sneakers, AND brand is Nike
// Numeric range filters
numericFilters: ['price >= 50', 'price <= 150'],
// Request facet counts for these attributes
facets: ['category', 'brand'],
// Pagination
hitsPerPage: 20,
page: 0,
// Highlighting
highlightPreTag: '<mark>',
highlightPostTag: '</mark>',
},
});
console.log(`${nbHits} results foundImplement Algolia indexing pipeline: data sync, partial updates, synonyms, and rules.
Algolia Core Workflow B — Indexing & Data Sync
Overview
Keep your Algolia index synchronized with your source database. Covers full reindex, incremental updates, partial updates, synonyms, and query rules.
Prerequisites
- Completed
algolia-install-authsetup - Familiarity with
algolia-core-workflow-a(search) - Source database or API with change tracking (timestamps, events)
Instructions
Step 1: Full Reindex with replaceAllObjects
import { algoliasearch } from 'algoliasearch';
const client = algoliasearch(process.env.ALGOLIA_APP_ID!, process.env.ALGOLIA_ADMIN_KEY!);
// replaceAllObjects atomically swaps index content
// Internally: creates temp index → indexes all records → moves temp to target
// Search continues on old data until swap is complete — zero downtime
async function fullReindex(records: Record<string, any>[]) {
const { taskID } = await client.replaceAllObjects({
indexName: 'products',
objects: records,
batchSize: 1000, // Records per batch (default 1000)
});
await client.waitForTask({ indexName: 'products', taskID });
console.log(`Full reindex complete: ${records.length} records`);
}
Step 2: Incremental Updates with partialUpdateObject
// Only update changed fields — much faster than full saveObjects
async function updateProductPrice(objectID: string, newPrice: number) {
await client.partialUpdateObject({
indexName: 'products',
objectID,
attributesToUpdate: {
price: newPrice,
updated_at: new Date().toISOString(),
},
createIfNotExists: false, // Don't create if missing
});
}
// Batch partial updates
async function syncPriceChanges(changes: { id: string; price: number }[]) {
const { taskID } = await client.partialUpdateObjects({
indexName: 'products',
objects: changes.map(c => ({
objectID: c.id,
price: c.price,
updated_at: new Date().toISOString(),
})),
createIfNotExists: false,
});
await client.waitForTask({ indexName: 'products', taskID });
}
Step 3: Manage Synonyms
// Synonyms help users find products with different terminology
await client.saveSynonyms({
indexName: 'products',
synonymHit: [
// Two-way synonym: any of these terms match each other
{
objectID: 'syn-1',
type: 'synonym',
synonyms: ['laptop', 'notebook', 'portable computer'],
},
// One-way synonym: "phone" also searches for "smartphone" but not reverse
{
objectID: 'syn-2',
type: 'oneWaySynonym',
input: 'phone',
synonyms: ['smartphone', 'mobile phone', 'cell phone'],
},
Optimize Algolia costs: understand search request vs record pricing, reduce operations with batching and caching, monitor usage via Analytics API.
Algolia Cost Tuning
Overview
Algolia pricing is based on search requests and records. A search request is one API call (which may contain multiple queries via search({ requests: [...] })). Records are counted across all indices including replicas.
Prerequisites
- Access to current Algolia usage, billing, and index statistics for the application being reviewed.
- An Admin or monitoring credential used only from a trusted backend environment.
- A reporting window that distinguishes production traffic from load tests and bots.
Pricing Structure (2025)
| Plan | Records Included | Search Requests | Additional Cost |
|---|---|---|---|
| Build (Free) | 1M records | 10K requests/mo | N/A |
| Grow | 100K free, then $0.40/1K | 10K free, then $0.50/1K | Pay as you go |
| Grow Plus | 100K free, then $0.40/1K | 10K free, then $1.75/1K | + AI features |
| Premium | Custom | Custom | Volume discounts |
What Counts as Records
- Every object in every index = 1 record
- Standard replicas duplicate records (multiply your count)
- Virtual replicas share records (no extra cost)
- Synonyms and rules do NOT count as records
What Counts as Search Requests
searchSingleIndex()= 1 requestsearch({ requests: [q1, q2, q3] })= 1 request (multi-query)browse()= 1 request per pagesaveObjects()= NOT a search request (indexing operations are free)
Instructions
Examples
The audit and analytics calls below show how to measure records, requests, and no-result searches before changing replicas, caching, or query design. Measure a baseline first so savings claims are testable.
Step 1: Audit Current Usage
import { algoliasearch } from 'algoliasearch';
const client = algoliasearch(process.env.ALGOLIA_APP_ID!, process.env.ALGOLIA_ADMIN_KEY!);
// Check total records across all indices
const { items } = await client.listIndices();
let totalRecords = 0;
let replicaRecords = 0;
items.forEach(idx => {
const records = idx.entries || 0;
console.log(`${idx.name}: ${records.toLocaleString()} records, ${(idx.dataSize || 0 / 1024).toFixed(0)}KB`);
if (idx.name.includes('_replica') || idx.primary) {
replicaRecords += records;
}
totalRecords += records;
});
console.log(`\nTotal: ${totalRecords.toLocaleString()} records (${replicaRecords.toLocaleString()} in replicas)`);
Step 2: Replace Standard Replicas with Virtual Replicas
// Standard replicas: duplicImplement Algolia data handling: record transforms, PII filtering before indexing, data retention, GDPR/CCPA compliance with Algolia's deleteByQuery and Insights deletion.
Algolia Data Handling
Overview
Algolia stores your records in their cloud. You control what data goes in (via saveObjects), what comes back (via attributesToRetrieve), and what users can search (via searchableAttributes). For privacy compliance, you must filter PII before indexing and implement deletion workflows.
Prerequisites
- A documented data classification for the source records and approval to index only the searchable fields.
- An Algolia Admin key held by the backend indexing job, never the browser.
- A deletion and retention owner for data-subject requests before production records are copied to Algolia.
Data Flow: Source → Algolia → User
Source Database Transform Algolia Index Search Response
┌──────────┐ ┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│ Full user │ │ Strip PII │ │ Searchable │ │ Retrieved │
│ record │ ──▶ │ Truncate │ ──▶ │ fields only │ ──▶ │ fields only │
│ (all cols)│ │ Normalize │ │ + ranking data │ │ (UI needs) │
└──────────┘ └──────────────┘ └──────────────────┘ └──────────────┘
Instructions
Examples
The transformations below demonstrate an allowlist-first record shape, explicit PII removal, deletion handling, and bounded retention. Apply the same policy to every source connector rather than relying on dashboard settings alone.
Step 1: Transform Records Before Indexing
import { algoliasearch } from 'algoliasearch';
const client = algoliasearch(process.env.ALGOLIA_APP_ID!, process.env.ALGOLIA_ADMIN_KEY!);
// Define what goes into Algolia — NOT everything from your DB
interface AlgoliaProduct {
objectID: string;
name: string;
description: string; // Truncated, plain text
category: string;
brand: string;
price: number;
in_stock: boolean;
image_url: string;
rating: number;
_tags: string[];
}
function transformForAlgolia(dbRecord: any): AlgoliaProduct {
return {
objectID: dbRecord.id,
name: dbRecord.name,
description: stripHtml(dbRecord.description).substring(0, 5000),
category: dbRecord.category?.name || 'uncategorized',
brand: dbRecord.brand?.name || '',
price: dbRecord.price_cents / 100,
in_stock: dbRecord.inventory_count > 0,
image_url: dbRecord.images?.[0]?.url || '',
rating: dbRecord.avg_rating || 0,
_tags: buildTags(dbRecord),
};
}
// Strip HTML tags for clean search text
function stripHtml(html: string): string {
return html?.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim() || '';
}
function buildTags(record: any): string[] {
const tags: string[] = [];
if (record.is_featured) tags.push('featured');
if (record.is_new) tags.push('neCollect Algolia debug evidence: index stats, API key ACLs, query logs, and network diagnostics for support tickets.
Algolia Debug Bundle
Overview
Collect all necessary diagnostic information for Algolia support tickets or internal troubleshooting. Uses real Algolia API endpoints to gather index stats, key permissions, and query performance data.
Prerequisites
ALGOLIA_APP_IDandALGOLIA_ADMIN_KEYenvironment variables setcurlandjqavailable- Permission to read API key ACLs and index settings
Instructions
Examples
The bundle script below is the support-ready example. It gathers configuration and response metadata into a timestamped directory while redacting secret values from the collected files.
Step 1: Create the Debug Bundle Script
#!/bin/bash
# algolia-debug-bundle.sh
set -euo pipefail
APP_ID="${ALGOLIA_APP_ID:?Set ALGOLIA_APP_ID}"
API_KEY="${ALGOLIA_ADMIN_KEY:?Set ALGOLIA_ADMIN_KEY}"
BUNDLE_DIR="algolia-debug-$(date +%Y%m%d-%H%M%S)"
BASE_URL="https://${APP_ID}-dsn.algolia.net"
HEADERS=(-H "X-Algolia-Application-Id: ${APP_ID}" -H "X-Algolia-API-Key: ${API_KEY}")
mkdir -p "$BUNDLE_DIR"
echo "=== Algolia Debug Bundle ===" | tee "$BUNDLE_DIR/summary.txt"
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)" | tee -a "$BUNDLE_DIR/summary.txt"
echo "App ID: $APP_ID" | tee -a "$BUNDLE_DIR/summary.txt"
# 1. List all indices with record counts
echo "--- Indices ---" >> "$BUNDLE_DIR/summary.txt"
curl -s "${BASE_URL}/1/indexes" "${HEADERS[@]}" \
| jq '.items[] | {name, entries, dataSize, lastBuildTimeS}' \
> "$BUNDLE_DIR/indices.json" 2>/dev/null
echo "Indices saved" >> "$BUNDLE_DIR/summary.txt"
# 2. Check API key permissions (redacted key)
echo "--- API Key ACL ---" >> "$BUNDLE_DIR/summary.txt"
curl -s "${BASE_URL}/1/keys" "${HEADERS[@]}" \
| jq '.keys[] | {description, acl, indexes, maxQueriesPerIPPerHour, validity}' \
> "$BUNDLE_DIR/api-keys-acl.json" 2>/dev/null
echo "Key ACLs saved (keys redacted)" >> "$BUNDLE_DIR/summary.txt"
# 3. Get recent query logs (last 1000)
echo "--- Query Logs ---" >> "$BUNDLE_DIR/summary.txt"
curl -s "${BASE_URL}/1/logs?length=100&type=all" "${HEADERS[@]}" \
| jq '.logs[] | {timestamp, method, url, answer_code, processing_time_ms, query_nb_hits}' \
> "$BUNDLE_DIR/query-logs.json" 2>/dev/null
echo "Last 100 log entries saved" >> "$BUNDLE_DIR/summary.txt"
# 4. Network connectivity test
echo "--- Network Diagnostics ---" >> "$BUNDLE_DIR/summary.txt"
for host in "${APP_ID}-dsn.algolia.net" &qDeploy Algolia-powered apps to Vercel, Fly.
Algolia Deploy Integration
Overview
Deploy Algolia-powered applications to production platforms with proper API key separation (Admin on backend, Search-Only on frontend) and InstantSearch widget integration.
Prerequisites
- Algolia App ID + Admin key (backend) + Search-Only key (frontend)
- Platform CLI installed (vercel, fly, or gcloud)
algoliasearchv5 for backend,react-instantsearchorinstantsearch.jsfor frontend
Instructions
Examples
The deployment patterns below keep the Admin key server-side and give the frontend only a search-safe credential. Exercise the health endpoint after rollout before directing user traffic to the new search surface.
Step 1: Backend API Key Configuration
Vercel
# Environment variables in Vercel
vercel env add ALGOLIA_APP_ID production # Your Application ID
vercel env add ALGOLIA_ADMIN_KEY production # Admin key (server-side only)
vercel env add ALGOLIA_SEARCH_KEY production # Search-only key (can be public)
# For client-side access (Next.js convention)
vercel env add NEXT_PUBLIC_ALGOLIA_APP_ID production
vercel env add NEXT_PUBLIC_ALGOLIA_SEARCH_KEY production
Fly.io
fly secrets set \
ALGOLIA_APP_ID=YourApplicationID \
ALGOLIA_ADMIN_KEY=your_admin_key \
ALGOLIA_SEARCH_KEY=your_search_key
Google Cloud Run
# Store in Secret Manager
echo -n "your_admin_key" | gcloud secrets create algolia-admin-key --data-file=-
echo -n "your_search_key" | gcloud secrets create algolia-search-key --data-file=-
# Deploy with secrets mounted as env vars
gcloud run deploy search-service \
--image gcr.io/$PROJECT_ID/search-service \
--set-secrets=ALGOLIA_ADMIN_KEY=algolia-admin-key:latest,ALGOLIA_SEARCH_KEY=algolia-search-key:latest \
--region us-central1
Step 2: Backend Search API (Next.js API Route)
// app/api/search/route.ts
import { algoliasearch } from 'algoliasearch';
import { NextRequest, NextResponse } from 'next/server';
const client = algoliasearch(
process.env.ALGOLIA_APP_ID!,
process.env.ALGOLIA_ADMIN_KEY!
);
export async function GET(request: NextRequest) {
const query = request.nextUrl.searchParams.get('q') || '';
const page = parseInt(request.nextUrl.searchParams.get('page') || '0');
const { hits, nbHits, nbPages } = await client.searchSingleIndex({
indexName: 'products',
searchParams: {
query,
hitsPerPage: 20,
page,
attributesToRetrieve: ['name', 'price', 'image_url', 'category'],
attributesToHighlight: ['name'],
},
});
return NextResponse.json({ hits, totalHits: nbHits, totalPages: nbPConfigure Algolia enterprise access control: team-scoped API keys, Secured API Keys for multi-tenant RBAC, dashboard team management, and audit logging.
Algolia Enterprise RBAC
Overview
Algolia's access control is built on API keys with ACL (Access Control Lists). Each key has specific permissions, index restrictions, and rate limits. For multi-tenant apps, Secured API Keys provide per-user filtering without creating individual keys. For team management, Algolia's dashboard supports team members with role-based access.
Prerequisites
- An Algolia organization or application administrator authorized to inspect and change API-key ACLs.
- A current inventory of services, users, and indices that require access.
- A safe rotation path for any key whose ACL or validity will change.
API Key ACL Permissions
| ACL | Operations Allowed | Use For |
|---|---|---|
search |
Search queries | Frontend, search-only clients |
browse |
Browse/export all records | Data export, migration scripts |
addObject |
Add or replace records | Indexing pipelines |
deleteObject |
Delete records | Data cleanup, GDPR deletion |
editSettings |
Modify index settings | Deployment scripts |
listIndexes |
List all indices | Monitoring, health checks |
deleteIndex |
Delete entire indices | Admin operations only |
analytics |
Read analytics data | Dashboards, reporting |
recommendation |
Algolia Recommend API | Product recommendations |
usage |
Read usage data | Billing monitoring |
logs |
Read API logs | Debugging, audit |
Instructions
Examples
The API-key and role examples below show least-privilege grants for common service and tenant boundaries. Start with the narrowest index and ACL set, then verify it against the caller's actual operation.
Step 1: Define Application Roles
import { algoliasearch } from 'algoliasearch';
const client = algoliasearch(process.env.ALGOLIA_APP_ID!, process.env.ALGOLIA_ADMIN_KEY!);
// Role definitions with minimal permissions
const ROLES = {
// Backend search service: search only, scoped to specific indices
searchService: {
acl: ['search'] as const,
description: 'Search service — production read-only',
indexes: ['products', 'articles'],
maxQueriesPerIPPerHour: 100000,
},
// Indexing pipeline: write records, no search or delete
indexingPipeline: {
acl: ['addObject', 'editSettings', 'Create a minimal working Algolia example — index records and search them.
Algolia Hello World
Overview
Index records into Algolia and search them back — the two fundamental operations. Uses the algoliasearch v5 client where all methods live on the client directly (no initIndex).
Prerequisites
algoliasearchv5 installed (npm install algoliasearch)ALGOLIA_APP_IDandALGOLIA_ADMIN_KEYenvironment variables set- See
algolia-install-authfor setup
Instructions
Step 1: Index Records with saveObjects
import { algoliasearch } from 'algoliasearch';
const client = algoliasearch(
process.env.ALGOLIA_APP_ID!,
process.env.ALGOLIA_ADMIN_KEY!
);
// saveObjects adds or replaces records. Each must have objectID
// (or Algolia auto-generates one).
const { taskID } = await client.saveObjects({
indexName: 'movies',
objects: [
{ objectID: '1', title: 'The Matrix', year: 1999, genre: 'sci-fi' },
{ objectID: '2', title: 'Inception', year: 2010, genre: 'sci-fi' },
{ objectID: '3', title: 'Pulp Fiction', year: 1994, genre: 'crime' },
],
});
// Wait for indexing to complete before searching
await client.waitForTask({ indexName: 'movies', taskID });
console.log('Indexing complete.');
Step 2: Search with searchSingleIndex
// Basic search — Algolia searches all searchableAttributes by default
const { hits } = await client.searchSingleIndex({
indexName: 'movies',
searchParams: { query: 'matrix' },
});
console.log(`Found ${hits.length} results:`);
hits.forEach(hit => {
// _highlightResult shows which parts matched
console.log(` ${hit.title} (${hit.year})`);
});
Step 3: Configure Index Settings
// Settings define how Algolia ranks results
await client.setSettings({
indexName: 'movies',
indexSettings: {
searchableAttributes: ['title', 'genre'], // Fields to search
attributesForFaceting: ['genre', 'year'], // Filterable fields
customRanking: ['desc(year)'], // Tie-breaker: newer first
attributesToRetrieve: ['title', 'year', 'genre'],// Fields returned in hits
},
});
Output
Indexing complete.
Found 1 results:
The Matrix (1999)
Error Handling
| Error | Cause | Solution | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Invalid Application-ID or API key |
Wrong credentials | Verify in dashboard > Settings > API Keys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Record is too big |
Object > 10KB (free) or 100KB (paid) | Reduce record size
algolia-incident-runbook
View full skill →
Execute Algolia incident response: triage search failures, distinguish Algolia-side vs your-side issues, apply fallbacks, and run postmortems.
ReadGrepBash(curl:*)Bash(npm:*)
Algolia Incident RunbookOverviewRapid incident response procedures for Algolia search failures. Algolia's infrastructure is distributed across multiple data centers with automatic failover, so true Algolia outages are rare. Most incidents are caused by API key issues, settings drift, or indexing pipeline failures on your side. Prerequisites
InstructionsUse the severity classification and triage sequence below to establish impact before changing settings or reindexing. Record timestamps, request IDs, and the decision owner as the incident progresses. ExamplesThe decision tree, remediation table, and communication templates are executable incident examples: choose the branch matching observed impact and send only the update appropriate to the confirmed severity. Severity Classification
Quick Triage (Run These First)
algolia-install-auth
View full skill →
Install and configure the Algolia JavaScript v5 client with proper API key management.
ReadWriteEditBash(npm:*)Bash(pnpm:*)Bash(npx:*)Grep
Algolia Install & AuthOverviewSet up the Prerequisites
InstructionsStep 1: Install the Client
Step 2: Configure Environment Variables
Key types and when to use them:
Step 3: Initialize the Client
Step 4: Verify Connection
OutputThe project has a v5 Algolia
algolia-local-dev-loop
View full skill →
Configure Algolia local development with separate dev index, mocking, and testing.
ReadWriteEditBash(npm:*)Bash(pnpm:*)Bash(npx:*)Grep
Algolia Local Dev LoopOverviewSet up a fast, reproducible local development workflow for Algolia. Use separate dev indices, mock the client in tests, and iterate without touching production data. Prerequisites
InstructionsStep 1: Environment-Based Index Names
Step 2: Seed Script for Dev Data
Step 3: Mock Algolia in Unit Tests
algolia-migration-deep-dive
View full skill →
Migrate to Algolia from Elasticsearch, Typesense, or Meilisearch.
ReadWriteEditBash(npm:*)Bash(node:*)Bash(curl:*)
Algolia Migration Deep DiveOverviewComprehensive guide for migrating from another search engine (Elasticsearch, Typesense, Meilisearch, or custom) to Algolia. Uses the strangler fig pattern: run old and new in parallel, gradually shift traffic, then cut over. Prerequisites
Migration Planning
InstructionsExamplesThe migration commands and comparison checks below illustrate a staged copy, validation, and cutover. Rehearse them against the target index before scheduling any production alias or frontend switch. Step 1: Assess Current Implementation
Step 2: Create the Adapter Layer
algolia-multi-env-setup
View full skill →
Configure Algolia across dev/staging/production: index prefixing, per-environment API keys, settings-as-code, and environment isolation guards.
ReadWriteEditBash(npm:*)Bash(gcloud:*)Bash(vault:*)
Algolia Multi-Environment SetupOverviewAlgolia doesn't have built-in environment separation. You either use separate Algolia applications (strongest isolation) or index prefixing within one application (simpler). This skill covers both approaches. Prerequisites
Environment Strategies
InstructionsExamplesThe index-prefix and configuration examples below demonstrate environment isolation and controlled promotion. Keep the same convention in local tooling, CI, and runtime configuration to avoid cross-environment writes. Step 1: Index Prefixing (Recommended for Most Teams)
Step 2: Scoped API Keys Per Environment
algolia-observability
View full skill →
Set up observability for Algolia: Prometheus metrics for search latency/errors, OpenTelemetry tracing, structured logging, and Grafana dashboards.
ReadWriteEdit
Algolia ObservabilityOverviewAlgolia provides built-in analytics in the dashboard, but production systems need application-level observability: latency histograms, error rate counters, distributed traces, and alerts. This skill instruments the Prerequisites
Key Metrics to Track
InstructionsExamplesThe client wrapper, metrics endpoint, tracing, and alert examples below create a correlated view of search latency, errors, and index activity. Preserve request IDs and aggregate labels; never emit search credentials in telemetry. Step 1: Instrumented Algolia Client Wrapper
algolia-performance-tuning
View full skill →
Optimize Algolia search performance: record size, searchable attributes, replica strategy, response caching, and query-time parameter tuning.
ReadWriteEdit
Algolia Performance TuningOverviewAlgolia's edge infrastructure typically delivers search in < 50ms globally. When performance degrades, the causes are usually: oversized records, too many searchable attributes, unoptimized faceting, or missing client-side caching. This skill covers server-side and client-side optimizations. Prerequisites
Performance Baselines
InstructionsExamplesThe record, attribute, facet, cache, query, and replica examples below are measured tuning levers. Change one lever at a time and compare the stated baseline rather than optimizing for a synthetic request alone. Step 1: Optimize Record Size
Step 2: Optimize Searchable Attributes
algolia-prod-checklist
View full skill →
Execute Algolia production readiness checklist: index settings, key security, replica configuration, monitoring, and rollback procedures.
ReadBash(curl:*)Bash(npm:*)Grep
Algolia Production ChecklistOverviewComplete checklist for deploying Algolia search to production. Covers index configuration, API key security, replica setup, monitoring, and rollback procedures. Prerequisites
InstructionsRun the checklist in order, record each result, and stop the deployment on any failed security, relevance, or availability requirement. Use the verification script only after every prerequisite configuration item is confirmed. ExamplesThe checklist and pre-deploy script are the release example: run them against the intended production index and attach the results to the deployment record before enabling the new search experience. Pre-Production ChecklistIndex Configuration
API Key Security
Replicas (Alternate Sorting)
algolia-rate-limits
View full skill →
Handle Algolia rate limits and throttling: per-key limits, indexing queue limits, 429 responses, and backoff strategies.
ReadWriteEdit
Algolia Rate LimitsOverviewAlgolia has two distinct rate limiting mechanisms: per-API-key limits (configurable, returns HTTP 429) and server-side indexing limits (protects cluster stability, returns HTTP 429 with specific messages). The Prerequisites
How Algolia Rate Limiting WorksPer-API-Key Rate Limits
Server-Side Indexing LimitsWhen the indexing queue is overloaded, Algolia returns 429 with these messages:
InstructionsExamplesThe key configuration, backoff, and batch-indexing examples show bounded responses to rate pressure. Use jittered retries and queue limits rather than retrying every rejected request immediately. Step 1: Configure Per-Key Rate Limits
Step 2: Implement Backoff for Sustained 429s
algolia-reference-architecture
View full skill →
Implement Algolia reference architecture: index design, multi-index strategy, data pipeline, search service layer, and frontend/backend separation.
ReadGrep
Algolia Reference ArchitectureOverviewProduction-ready architecture for Algolia-powered search. Covers index design, data pipeline from source to Algolia, service layer patterns, and frontend integration. Prerequisites
InstructionsUse the architecture, project layout, and design patterns as a composable reference. Keep indexing, settings management, and search serving as separately testable boundaries rather than coupling them to a frontend component. ExamplesThe diagrams and TypeScript patterns below demonstrate the reference topology, record transformation, settings-as-code, and service-layer contracts. Adapt the interfaces to your source schema while preserving the key boundary between write and search credentials. Architecture Overview
Project Structure
algolia-sdk-patterns
View full skill →
Apply production-ready algoliasearch v5 patterns: singleton client, typed search, error handling, and batch operations.
ReadWriteEdit
Algolia SDK PatternsOverviewProduction-ready patterns for Prerequisites
InstructionsExamplesThe client, result, error, batch, and tenant examples below establish a consistent v5 SDK boundary. Centralize credentials and index naming in that boundary so individual callers do not reimplement error or retry policy. Pattern 1: Typed Singleton Client
Pattern 2: Typed Search Results
Pattern 3: Error Handling with Algolia Error Types
algolia-security-basics
View full skill →
Apply Algolia security best practices: API key scoping, secured API keys, frontend vs backend key separation, and key rotation.
ReadWriteEditGrep
Algolia Security BasicsOverviewAlgolia's security model is built around scoped API keys. Every Algolia app has three default keys (Admin, Search-Only, Monitoring). For production, create custom keys with minimal permissions and use Secured API Keys for per-user/per-tenant restrictions. Prerequisites
Key Types and Where to Use Them
InstructionsExamplesThe environment, scoped-key, secured-key, and rotation examples demonstrate least privilege at each trust boundary. Replace placeholder values through the secret store and validate the resulting ACL before a client receives the key. Step 1: Environment Variable Setup
Step 2: Create Scoped API Keys
algolia-upgrade-migration
View full skill →
Upgrade algoliasearch from v4 to v5 with breaking change detection and codemod.
ReadWriteEditBash(npm:*)Bash(git:*)Bash(npx:*)Grep
Algolia Upgrade & Migration (v4 to v5)OverviewGuide for upgrading Prerequisites
Breaking Changes Summary
InstructionsExamplesThe upgrade steps are concrete v4-to-v5 examples: replace client initialization and method calls, then run the search and type-check suite before widening rollout. Keep the pre-upgrade branch available until production verification succeeds. Step 1: Create Upgrade Branch and Install v5
algolia-webhooks-events
View full skill →
Implement Algolia Insights API for click/conversion tracking, search analytics, and real-time event-driven index updates via database change listeners.
ReadWriteEditBash(npm:*)Bash(curl:*)
Algolia Events & InsightsOverviewAlgolia doesn't use traditional webhooks. Instead, it provides the Insights API for sending user behavior events (clicks, conversions, views) back to Algolia, and the Analytics API for reading search performance data. For keeping your index in sync, you build event-driven pipelines from your database to Algolia. Prerequisites
InstructionsExamplesThe search, Insights, analytics, and database-sync snippets below show the event correlation contract end to end. Preserve the query ID and a stable user token, and route failed source-database events to a retryable queue rather than dropping them. Step 1: Enable Click Analytics in Search
Step 2: Send Click and Conversion Events (Backend)
Step 3: Frontend Event Tracking with search-insights
How It WorksSkills trigger automatically when you discuss Algolia topics:
Ready to use algolia-pack?Related Pluginssupabase-packComplete Supabase integration skill pack with 30 skills covering authentication, database, storage, realtime, edge functions, and production operations. Flagship+ tier vendor pack. /plugin install supabase-pack@claude-code-plugins-plus
vercel-packComplete Vercel integration skill pack with 30 skills covering deployments, edge functions, preview environments, performance optimization, and production operations. Flagship+ tier vendor pack. /plugin install vercel-pack@claude-code-plugins-plus
clay-packComplete Clay integration skill pack with 30 skills covering data enrichment, waterfall workflows, AI agents, and GTM automation. Flagship+ tier vendor pack. /plugin install clay-pack@claude-code-plugins-plus
cursor-packComplete Cursor integration skill pack with 30 skills covering AI code editing, composer workflows, codebase indexing, and productivity features. Flagship+ tier vendor pack. /plugin install cursor-pack@claude-code-plugins-plus
exa-packComplete Exa integration skill pack with 30 skills covering neural search, semantic retrieval, web search API, and AI-powered discovery. Flagship+ tier vendor pack. /plugin install exa-pack@claude-code-plugins-plus
firecrawl-packComplete Firecrawl integration skill pack with 30 skills covering web scraping, crawling, markdown conversion, and LLM-ready data extraction. Flagship+ tier vendor pack. /plugin install firecrawl-pack@claude-code-plugins-plus
Tags
algoliasaassdkintegration
|