apollo-multi-env-setup

Configure Apollo.io multi-environment setup. Use when setting up development, staging, and production environments, or managing multiple Apollo configurations. Trigger with phrases like "apollo environments", "apollo staging", "apollo dev prod", "apollo multi-tenant", "apollo env config".

25 stars

Best use case

apollo-multi-env-setup is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Configure Apollo.io multi-environment setup. Use when setting up development, staging, and production environments, or managing multiple Apollo configurations. Trigger with phrases like "apollo environments", "apollo staging", "apollo dev prod", "apollo multi-tenant", "apollo env config".

Teams using apollo-multi-env-setup should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/apollo-multi-env-setup/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/jeremylongshore/claude-code-plugins-plus-skills/apollo-multi-env-setup/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/apollo-multi-env-setup/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How apollo-multi-env-setup Compares

Feature / Agentapollo-multi-env-setupStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Configure Apollo.io multi-environment setup. Use when setting up development, staging, and production environments, or managing multiple Apollo configurations. Trigger with phrases like "apollo environments", "apollo staging", "apollo dev prod", "apollo multi-tenant", "apollo env config".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Apollo Multi-Environment Setup

## Overview
Configure Apollo.io for development, staging, and production with isolated API keys, environment-specific rate limits, feature gating, and Kubernetes-native secret management. Apollo provides sandbox tokens for testing that return dummy data without consuming credits.

## Prerequisites
- Separate Apollo API keys per environment (or sandbox tokens for dev)
- Node.js 18+

## Instructions

### Step 1: Environment Configuration Schema
```typescript
// src/config/apollo-config.ts
import { z } from 'zod';

const EnvironmentSchema = z.enum(['development', 'staging', 'production']);

const ApolloEnvConfig = z.object({
  environment: EnvironmentSchema,
  apiKey: z.string().min(10),
  baseUrl: z.string().url().default('https://api.apollo.io/api/v1'),
  isSandbox: z.boolean().default(false),
  rateLimit: z.object({
    maxPerMinute: z.number().min(1),
    concurrency: z.number().min(1).max(20),
  }),
  features: z.object({
    enrichment: z.boolean(),
    sequences: z.boolean(),
    deals: z.boolean(),
    bulkEnrichment: z.boolean(),
  }),
  credits: z.object({
    dailyBudget: z.number(),
    alertThreshold: z.number(),  // percentage
  }),
  logging: z.object({
    level: z.enum(['debug', 'info', 'warn', 'error']),
    redactPII: z.boolean(),
  }),
});

type ApolloEnvConfig = z.infer<typeof ApolloEnvConfig>;
```

### Step 2: Per-Environment Configs
```typescript
const configs: Record<string, ApolloEnvConfig> = {
  development: {
    environment: 'development',
    apiKey: process.env.APOLLO_SANDBOX_KEY ?? process.env.APOLLO_API_KEY_DEV!,
    baseUrl: 'https://api.apollo.io/api/v1',
    isSandbox: true,
    rateLimit: { maxPerMinute: 20, concurrency: 2 },
    features: { enrichment: true, sequences: false, deals: false, bulkEnrichment: false },
    credits: { dailyBudget: 10, alertThreshold: 80 },
    logging: { level: 'debug', redactPII: false },
  },
  staging: {
    environment: 'staging',
    apiKey: process.env.APOLLO_API_KEY_STAGING!,
    baseUrl: 'https://api.apollo.io/api/v1',
    isSandbox: false,
    rateLimit: { maxPerMinute: 50, concurrency: 5 },
    features: { enrichment: true, sequences: true, deals: true, bulkEnrichment: true },
    credits: { dailyBudget: 50, alertThreshold: 70 },
    logging: { level: 'info', redactPII: true },
  },
  production: {
    environment: 'production',
    apiKey: process.env.APOLLO_API_KEY_PROD!,
    baseUrl: 'https://api.apollo.io/api/v1',
    isSandbox: false,
    rateLimit: { maxPerMinute: 100, concurrency: 10 },
    features: { enrichment: true, sequences: true, deals: true, bulkEnrichment: true },
    credits: { dailyBudget: 500, alertThreshold: 90 },
    logging: { level: 'warn', redactPII: true },
  },
};
```

### Step 3: Environment-Aware Client Factory
```typescript
// src/config/client-factory.ts
import axios, { AxiosInstance } from 'axios';

export function createEnvClient(config: ApolloEnvConfig): AxiosInstance {
  const validated = ApolloEnvConfig.parse(config);

  const client = axios.create({
    baseURL: validated.baseUrl,
    headers: { 'Content-Type': 'application/json', 'x-api-key': validated.apiKey },
    timeout: validated.environment === 'development' ? 30_000 : 15_000,
  });

  // Feature gate: block disabled endpoints
  client.interceptors.request.use((req) => {
    if (req.url?.includes('/people/match') && !validated.features.enrichment)
      throw new Error(`Enrichment disabled in ${validated.environment}`);
    if (req.url?.includes('/emailer_campaigns') && !validated.features.sequences)
      throw new Error(`Sequences disabled in ${validated.environment}`);
    if (req.url?.includes('/opportunities') && !validated.features.deals)
      throw new Error(`Deals disabled in ${validated.environment}`);
    if (req.url?.includes('/people/bulk_match') && !validated.features.bulkEnrichment)
      throw new Error(`Bulk enrichment disabled in ${validated.environment}`);
    return req;
  });

  // Debug logging in dev
  if (validated.logging.level === 'debug') {
    client.interceptors.request.use((req) => {
      console.log(`[${validated.environment}] ${req.method?.toUpperCase()} ${req.url}`);
      return req;
    });
  }

  return client;
}

export function getClient(): AxiosInstance {
  const env = process.env.NODE_ENV ?? 'development';
  return createEnvClient(configs[env] ?? configs.development);
}
```

### Step 4: Kubernetes Secrets
```yaml
# k8s/dev/apollo-secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: apollo-credentials
  namespace: sales-dev
type: Opaque
stringData:
  APOLLO_SANDBOX_KEY: "sandbox-token-here"
  APOLLO_API_KEY_DEV: "dev-key-here"
---
# k8s/prod/apollo-secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: apollo-credentials
  namespace: sales-prod
type: Opaque
stringData:
  APOLLO_API_KEY_PROD: "master-key-here"
```

### Step 5: Environment Verification Script
```typescript
// src/scripts/verify-envs.ts
async function verifyAllEnvironments() {
  for (const [env, config] of Object.entries(configs)) {
    try {
      const client = createEnvClient(config);
      const { data } = await client.get('/auth/health');
      const isMaster = await testMasterAccess(client);
      console.log(`${env}: ${data.is_logged_in ? 'OK' : 'FAIL'} (${isMaster ? 'master' : 'standard'} key, sandbox: ${config.isSandbox})`);
    } catch (err: any) {
      console.error(`${env}: FAIL — ${err.message}`);
    }
  }
}

async function testMasterAccess(client: AxiosInstance): Promise<boolean> {
  try { await client.post('/contacts/search', { per_page: 1 }); return true; }
  catch { return false; }
}
```

## Output
- Zod-validated environment config schema with feature flags and credit budgets
- Three environment configs (dev with sandbox, staging, production)
- Client factory with feature gating and debug logging
- Kubernetes secrets per namespace
- Environment verification script testing all configs

## Error Handling
| Issue | Resolution |
|-------|------------|
| Feature disabled | Client throws descriptive error identifying which env blocked it |
| Wrong environment | Check `NODE_ENV`, client falls back to development |
| Missing API key | Zod throws with clear validation error |
| Sandbox returning dummy data | Expected in development — use staging for real data testing |

## Resources
- [Apollo Sandbox Testing](https://docs.apollo.io/docs/test-api-key)
- [Create API Keys](https://docs.apollo.io/docs/create-api-key)
- [12-Factor App Config](https://12factor.net/config)
- [Kubernetes Secrets](https://kubernetes.io/docs/concepts/configuration/secret/)

## Next Steps
Proceed to `apollo-observability` for monitoring setup.

Related Skills

websocket-handler-setup

25
from ComeOnOliver/skillshub

Websocket Handler Setup - Auto-activating skill for Backend Development. Triggers on: websocket handler setup, websocket handler setup Part of the Backend Development skill category.

vpc-network-setup

25
from ComeOnOliver/skillshub

Vpc Network Setup - Auto-activating skill for GCP Skills. Triggers on: vpc network setup, vpc network setup Part of the GCP Skills skill category.

tensorflow-serving-setup

25
from ComeOnOliver/skillshub

Tensorflow Serving Setup - Auto-activating skill for ML Deployment. Triggers on: tensorflow serving setup, tensorflow serving setup Part of the ML Deployment skill category.

sqs-queue-setup

25
from ComeOnOliver/skillshub

Sqs Queue Setup - Auto-activating skill for AWS Skills. Triggers on: sqs queue setup, sqs queue setup Part of the AWS Skills skill category.

spy-setup-helper

25
from ComeOnOliver/skillshub

Spy Setup Helper - Auto-activating skill for Test Automation. Triggers on: spy setup helper, spy setup helper Part of the Test Automation skill category.

spike-test-setup

25
from ComeOnOliver/skillshub

Spike Test Setup - Auto-activating skill for Performance Testing. Triggers on: spike test setup, spike test setup Part of the Performance Testing skill category.

sla-monitor-setup

25
from ComeOnOliver/skillshub

Sla Monitor Setup - Auto-activating skill for Enterprise Workflows. Triggers on: sla monitor setup, sla monitor setup Part of the Enterprise Workflows skill category.

server-sent-events-setup

25
from ComeOnOliver/skillshub

Server Sent Events Setup - Auto-activating skill for API Integration. Triggers on: server sent events setup, server sent events setup Part of the API Integration skill category.

react-context-setup

25
from ComeOnOliver/skillshub

React Context Setup - Auto-activating skill for Frontend Development. Triggers on: react context setup, react context setup Part of the Frontend Development skill category.

rds-instance-setup

25
from ComeOnOliver/skillshub

Rds Instance Setup - Auto-activating skill for AWS Skills. Triggers on: rds instance setup, rds instance setup Part of the AWS Skills skill category.

rabbitmq-queue-setup

25
from ComeOnOliver/skillshub

Rabbitmq Queue Setup - Auto-activating skill for Backend Development. Triggers on: rabbitmq queue setup, rabbitmq queue setup Part of the Backend Development skill category.

pre-commit-hook-setup

25
from ComeOnOliver/skillshub

Pre Commit Hook Setup - Auto-activating skill for DevOps Basics. Triggers on: pre commit hook setup, pre commit hook setup Part of the DevOps Basics skill category.