jeremylongshore

apollo-local-dev-loop

@jeremylongshore/apollo-local-dev-loop
jeremylongshore
1,004
123 forks
Updated 1/18/2026
View on GitHub

Configure Apollo.io local development workflow. Use when setting up development environment, testing API calls locally, or establishing team development practices. Trigger with phrases like "apollo local dev", "apollo development setup", "apollo dev environment", "apollo testing locally".

Installation

$skills install @jeremylongshore/apollo-local-dev-loop
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Pathplugins/saas-packs/apollo-pack/skills/apollo-local-dev-loop/SKILL.md
Branchmain
Scoped Name@jeremylongshore/apollo-local-dev-loop

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

skills list

Skill Instructions


name: apollo-local-dev-loop description: | Configure Apollo.io local development workflow. Use when setting up development environment, testing API calls locally, or establishing team development practices. Trigger with phrases like "apollo local dev", "apollo development setup", "apollo dev environment", "apollo testing locally". allowed-tools: Read, Write, Edit, Bash(npm:), Bash(pip:), Grep version: 1.0.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io

Apollo Local Dev Loop

Overview

Set up efficient local development workflow for Apollo.io integrations with proper environment management, testing, and debugging.

Prerequisites

  • Completed apollo-install-auth setup
  • Node.js 18+ or Python 3.10+
  • Git repository initialized

Instructions

Step 1: Environment Setup

# Create environment files
touch .env .env.example .env.test

# Add to .gitignore
echo '.env' >> .gitignore
echo '.env.local' >> .gitignore
# .env.example (commit this)
APOLLO_API_KEY=your-api-key-here
APOLLO_RATE_LIMIT=100
APOLLO_ENV=development

Step 2: Create Development Client

// src/lib/apollo-dev.ts
import axios from 'axios';

const isDev = process.env.NODE_ENV !== 'production';

export const apolloClient = axios.create({
  baseURL: 'https://api.apollo.io/v1',
  params: { api_key: process.env.APOLLO_API_KEY },
});

// Add request logging in development
if (isDev) {
  apolloClient.interceptors.request.use((config) => {
    console.log(`[Apollo] ${config.method?.toUpperCase()} ${config.url}`);
    return config;
  });

  apolloClient.interceptors.response.use(
    (response) => {
      console.log(`[Apollo] Response: ${response.status}`);
      return response;
    },
    (error) => {
      console.error(`[Apollo] Error: ${error.response?.status}`, error.message);
      return Promise.reject(error);
    }
  );
}

Step 3: Create Mock Server for Testing

// src/mocks/apollo-mock.ts
import { rest } from 'msw';

export const apolloHandlers = [
  rest.post('https://api.apollo.io/v1/people/search', (req, res, ctx) => {
    return res(
      ctx.json({
        people: [
          { id: '1', name: 'Test User', title: 'Engineer', email: 'test@example.com' },
        ],
        pagination: { page: 1, per_page: 10, total_entries: 1 },
      })
    );
  }),

  rest.get('https://api.apollo.io/v1/organizations/enrich', (req, res, ctx) => {
    return res(
      ctx.json({
        organization: {
          name: 'Test Company',
          domain: 'test.com',
          industry: 'Technology',
        },
      })
    );
  }),
];

Step 4: Development Scripts

{
  "scripts": {
    "dev": "NODE_ENV=development tsx watch src/index.ts",
    "dev:mock": "MOCK_APOLLO=true npm run dev",
    "test:apollo": "vitest run src/**/*.apollo.test.ts",
    "apollo:quota": "tsx scripts/check-apollo-quota.ts"
  }
}

Step 5: Quota Monitoring Script

// scripts/check-apollo-quota.ts
import { apolloClient } from '../src/lib/apollo-dev';

async function checkQuota() {
  try {
    const { data } = await apolloClient.get('/auth/health');
    console.log('API Status:', data);
    // Note: Apollo doesn't expose quota directly, track usage manually
  } catch (error: any) {
    if (error.response?.status === 429) {
      console.error('Rate limited! Wait before making more requests.');
    }
  }
}

checkQuota();

Output

  • Environment file structure (.env, .env.example)
  • Development client with logging interceptors
  • Mock server for testing without API calls
  • npm scripts for development workflow
  • Quota monitoring utility

Error Handling

ErrorCauseSolution
Missing API Key.env not loadedRun source .env or use dotenv
Mock Not WorkingMSW not configuredEnsure setupServer is called
Rate Limited in DevToo many test callsUse mock server for tests
Stale CredentialsKey rotatedUpdate .env with new key

Examples

Watch Mode Development

# Terminal 1: Run dev server with watch
npm run dev

# Terminal 2: Test API calls
curl -X POST http://localhost:3000/api/apollo/search \
  -H "Content-Type: application/json" \
  -d '{"domain": "stripe.com"}'

Testing with Mocks

// src/services/apollo.apollo.test.ts
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import { setupServer } from 'msw/node';
import { apolloHandlers } from '../mocks/apollo-mock';
import { searchPeople } from './apollo';

const server = setupServer(...apolloHandlers);

beforeAll(() => server.listen());
afterAll(() => server.close());

describe('Apollo Service', () => {
  it('searches for people', async () => {
    const results = await searchPeople({ domain: 'test.com' });
    expect(results.people).toHaveLength(1);
    expect(results.people[0].name).toBe('Test User');
  });
});

Resources

Next Steps

Proceed to apollo-sdk-patterns for production-ready code patterns.

More by jeremylongshore

View all
rabbitmq-queue-setup
1,004

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

model-evaluation-suite
1,004

evaluating-machine-learning-models: This skill allows Claude to evaluate machine learning models using a comprehensive suite of metrics. It should be used when the user requests model performance analysis, validation, or testing. Claude can use this skill to assess model accuracy, precision, recall, F1-score, and other relevant metrics. Trigger this skill when the user mentions "evaluate model", "model performance", "testing metrics", "validation results", or requests a comprehensive "model evaluation".

neural-network-builder
1,004

building-neural-networks: This skill allows Claude to construct and configure neural network architectures using the neural-network-builder plugin. It should be used when the user requests the creation of a new neural network, modification of an existing one, or assistance with defining the layers, parameters, and training process. The skill is triggered by requests involving terms like "build a neural network," "define network architecture," "configure layers," or specific mentions of neural network types (e.g., "CNN," "RNN," "transformer").

oauth-callback-handler
1,004

Oauth Callback Handler - Auto-activating skill for API Integration. Triggers on: oauth callback handler, oauth callback handler Part of the API Integration skill category.