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)
'Configure Algolia CI/CD: GitHub Actions for index validation, automated.
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
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][] = [
['searchableAttributes', actual.searchableAttributes, expectedSettings.searchableAttributes],
['attributesForFaceting', actual.attributesForFaceting, expectedSettings.attributesForFaceting],
['customRanking', actual.customRanking, expected'Diagnose and fix the top Algolia API errors: 400, 403, 404, 429, ApiError,.
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.
Error Reference
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's maxQueriesPerIPPerHour exceeded, or server-side indexing rate limit hit.
Fix:
// Algolia's built-in retry handles transient 429s.
// For sustained rate limits:
// 1. Reduce batch frequency
const BATCH_SIZE = 500; // Down from 1000
// 2. Add delay between batches
for (const batch of chunks) {
await client.saveObjects({ indexName: 'products', objects: batch });
await new Promise(r => setTimeout(r, 200)); // 200ms pause between batches
}
// 3. Check/increase key rate limit
// Dashboard > Settings > API Keys >'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 found`);
'Implement Algolia indexing pipeline: data sync, partial updates, synonyms,.
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,.
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.
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
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: duplicate all records (doubles cost)
// Virtual replicas: share records with primary (no extra cost)
// BEFORE: 3 standard replicas = 4x record count
await client.setSettings({
indexName: 'products',
indexSettings: {
replicas: [
// 'products_price_asc', // Standard: costs records
// 'products_price_desc', // Standard: costs records
'virtual(products_price_asc)', // Virtual: FREE
'virtual(products_price_desc)', // Virtual: FREE
],
},
});
// Virtual replica limitation:'Implement Algolia data handling: record transforms, PII filtering before.
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.
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
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('new-arrival');
if (record.discount_percent > 0) tags.push('on-sale');
return tags;
}
Step 2: PII Detection and Filtering
// NEVER index PII unless absolutely necessary for search
const PII_FIELDS = ['email', 'phone', 'ssn', 'address', 'credit_card', 'password', 'api_key'];
function stripPII(record: Record<string, any>): Record<string, any> {
const clean = { ...record };
for (const field of PII_FIELDS) {
delete clean[field];
}
return clean;
}
/'Collect Algolia debug evidence: index stats, API key ACLs, query logs,.
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
ALGOLIAAPPIDandALGOLIAADMINKEYenvironment variables setcurlandjqavailable- Permission to read API key ACLs and index settings
Instructions
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" "${APP_ID}-1.algolianet.com" "${APP_ID}-2.algolianet.com"; do
RESULT=$(curl -s -o /dev/null -w "%{http_code},%{time_total}" "https://${host}/1/indexes" "'Deploy 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
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: nbPages, page });
}
Step 3: Frontend with InstantSearch (React)
npm install react-instantsearch algoliasearch
// components/AlgoliaSearch.tsx
import'Configure Algolia enterprise access control: team-scoped API keys, Secured.
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.
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
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', 'listIndexes'] as const,
description: 'Indexing pipeline — write-only, no delete',
indexes: ['products', 'articles'],
maxQueriesPerIPPerHour: 10000,
},
// Analytics dashboard: read analytics, no data access
analyticsDashboard: {
acl: ['analytics', 'usage', 'listIndexes'] as const,
description: 'Analytics reader — no record access',
indexes: ['products', 'articles'],
maxQueriesPerIPPerHour: 5000,
},
// Data admin: full CRUD, "Create a minimal working Algolia example \u2014 index records and search\.
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)ALGOLIAAPPIDandALGOLIAADMINKEYenvironment 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
'Execute Algolia incident response: triage search failures, distinguish.
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. Severity Classification
Quick Triage (Run These First)
Decision Tree'Install and configure the Algolia JavaScript v5 client with proper API.
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
Error Handling
InstructionsStep 1: Assess Current Implementation
Step 2: Create the Adapter Layer
Step 3: Implement the Algolia Adapter'Configure Algolia across dev/staging/production: index prefixing, per-environment.
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. Environment Strategies
InstructionsStep 1: Index Prefixing (Recommended for Most Teams)
Step 2: Scoped API Keys Per Environment'Set up observability for Algolia: Prometheus metrics for search latency/errors,.
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 Key Metrics to Track
InstructionsStep 1: Instrumented Algolia Client Wrapper'Optimize Algolia search performance: record size, searchable attributes,.
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. Performance Baselines
InstructionsStep 1: Optimize Record Size
Step 2: Optimize Searchable Attributes
Step 3: Optimize Faceting
'Execute Algolia production readiness checklist: index settings, key.
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. Pre-Production ChecklistIndex Configuration
API Key Security
Replicas (Alternate Sorting)
Monitoring
'Handle Algolia rate limits and throttling: per-key limits, indexing.
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 How Algolia Rate Limiting WorksPer-API-Key Rate Limits
Server-Side Indexing LimitsWhen the indexing queue is overloaded, Algolia returns 429 with these messages:
InstructionsStep 1: Configure Per-Key Rate Limits
Step 2: Implement Backoff for Sustained 429s'Implement Algolia reference architecture: index design, multi-index.
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. Architecture Overview
Project Structure
'Apply production-ready algoliasearch v5 patterns: singleton client,.
ReadWriteEdit
Algolia SDK PatternsOverviewProduction-ready patterns for Prerequisites
InstructionsPattern 1: Typed Singleton Client
Pattern 2: Typed Search Results
Pattern 3: Error Handling with Algolia Error Types'Apply Algolia security best practices: API key scoping, secured API.
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. Key Types and Where to Use Them
InstructionsStep 1: Environment Variable Setup
Step 2: Create Scoped API Keys
Step 3: Generate Secured API Keys (Per-User Filtering)'Upgrade algoliasearch from v4 to v5 with breaking change detection and.
ReadWriteEditBash(npm:*)Bash(git:*)Bash(npx:*)Grep
Algolia Upgrade & Migration (v4 to v5)OverviewGuide for upgrading Prerequisites
Breaking Changes Summary
InstructionsStep 1: Create Upgrade Branch and Install v5
Step 2: Update Imports'Implement Algolia Insights API for click/conversion tracking, search.
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
InstructionsStep 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. vercel-packComplete Vercel integration skill pack with 30 skills covering deployments, edge functions, preview environments, performance optimization, and production operations. Flagship+ tier vendor pack. clay-packComplete Clay integration skill pack with 30 skills covering data enrichment, waterfall workflows, AI agents, and GTM automation. Flagship+ tier vendor pack. cursor-packComplete Cursor integration skill pack with 30 skills covering AI code editing, composer workflows, codebase indexing, and productivity features. Flagship+ tier vendor pack. 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. firecrawl-packComplete Firecrawl integration skill pack with 30 skills covering web scraping, crawling, markdown conversion, and LLM-ready data extraction. Flagship+ tier vendor pack.
Tags
algoliasaassdkintegration
|