algolia-multi-env-setup

Featured

Configure Algolia across dev/staging/production: index prefixing, per-environment API keys, settings-as-code, and environment isolation guards. Trigger: "algolia environments", "algolia staging", "algolia dev prod", "algolia environment setup", "algolia config by env".

AI & Automation 2,944 stars 440 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Algolia Multi-Environment Setup ## Overview Algolia 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 | Strategy | Isolation | Cost | Complexity | |----------|-----------|------|------------| | Index prefixing | Shared app, prefixed names | Lowest | Low | | Separate API keys | Shared app, scoped keys | Low | Medium | | Separate applications | Full isolation | Highest | High | ## Instructions ### Step 1: Index Prefixing (Recommended for Most Teams) ```typescript // src/algolia/config.ts import { algoliasearch, type Algoliasearch } from 'algoliasearch'; type Environment = 'development' | 'staging' | 'production'; interface AlgoliaConfig { appId: string; apiKey: string; searchKey: string; environment: Environment; } function getConfig(): AlgoliaConfig { const env = (process.env.NODE_ENV || 'development') as Environment; return { appId: process.env.ALGOLIA_APP_ID!, apiKey: process.env.ALGOLIA_ADMIN_KEY!, searchKey: process.env.ALGOLIA_SEARCH_KEY!, environment: env, }; } // Prefix index names with environment export function indexName(base: string): string { const { environment } = getConfig(); if (environment === 'production') return base; // No prefix in prod return `${environment}_${base}`; // development_products, staging_products, products } ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category