| name | brightdata-local-dev-loop |
| description | Configure Bright Data local development with hot reload and testing.
Use when setting up a development environment, configuring test workflows,
or establishing a fast iteration cycle with Bright Data.
Trigger with phrases like "brightdata dev setup", "brightdata local development",
"brightdata dev environment", "develop with brightdata".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(pnpm:*), Grep |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","scraping","data","brightdata"] |
| compatibility | Designed for Claude Code |
Bright Data Local Dev Loop
Overview
Set up a fast, reproducible local development workflow for Bright Data scraping projects with mocked proxy responses, cached results, and vitest integration.
Prerequisites
- Completed
brightdata-install-auth setup
- Node.js 18+ with npm/pnpm
- brd-ca.crt SSL certificate downloaded
Instructions
Step 1: Create Project Structure
my-scraper/
├── src/
│ ├── brightdata/
│ │ ├── proxy.ts # Proxy configuration helper
│ │ ├── scraper.ts # Scraping functions
│ │ └── cache.ts # Response caching for dev
│ └── index.ts
├── tests/
│ ├── fixtures/ # Cached HTML responses
│ │ └── example.html
│ └── scraper.test.ts
├── .env.local # Local credentials (git-ignored)
├── .env.example # Template for team
├── brd-ca.crt # Bright Data SSL cert (git-ignored)
└── package.json
Step 2: Build Proxy Configuration Module
import 'dotenv/config';
export interface BrightDataProxy {
host: string;
port: number;
auth: { username: string; password: string };
}
export function getProxy(options?: {
country?: string;
city?: string;
session?: string;
}): BrightDataProxy {
const { BRIGHTDATA_CUSTOMER_ID, BRIGHTDATA_ZONE, BRIGHTDATA_ZONE_PASSWORD } = process.env;
if (!BRIGHTDATA_CUSTOMER_ID || ! || !) {
();
}
username = ;
(options?.) username += ;
(options?.) username += ;
(options?.) username += ;
{
: ,
: ,
: { username, : },
};
}