
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A simple Node.js SDK for the Bright Data API.
npm install akbdsdk
example.js:const { BrightDataClient } = require('akbdsdk');
// STEP 1: Initialize the client with your API key
// Replace 'your-api-key-here' with your actual Bright Data API key
const client = new BrightDataClient({
apiKey: 'your-api-key-here'
});
async function scrapeWebsite() {
try {
// STEP 2: Trigger the collection
// Replace 'your-dataset-id' with your actual Bright Data Dataset ID
const triggerResponse = await client.triggerCollection({
dataset_id: 'your-dataset-id',
urls: [{
// Replace these values with your target website and requirements
url: 'https://www.example.com',
prompt: 'Extract all content',
country: 'US'
}]
});
console.log('Collection started. Snapshot ID:', triggerResponse.snapshot_id);
// STEP 3: Wait for the snapshot to be ready
const status = await client.waitForSnapshot(triggerResponse.snapshot_id, {
maxAttempts: 10,
delayMs: 30000,
onProgress: (status) => {
console.log('Progress:', {
pages_crawled: status.progress?.pages_crawled || 0,
pages_extracted: status.progress?.pages_extracted || 0,
pages_failed: status.progress?.pages_failed || 0
});
}
});
console.log('Snapshot is ready:', status.status);
// STEP 4: Download the results
const results = await client.downloadSnapshot({
job_id: triggerResponse.snapshot_id,
format: 'json'
});
console.log('Scraping completed successfully!');
console.log('Results URL:', results.url);
return results;
} catch (error) {
console.error('Error:', error);
throw error;
}
}
// Run the example
scrapeWebsite().catch(console.error);
Update the following values in the code:
'your-api-key-here' with your Bright Data API key'your-dataset-id' with your Bright Data Dataset IDRun the example:
node example.js
STEP 1: Initialize the Client
STEP 2: Trigger Collection
STEP 3: Wait for Snapshot
STEP 4: Download Results
If you encounter errors, here are some common issues and solutions:
API Key Issues
// Make sure your API key is correct and properly formatted
const client = new BrightDataClient({
apiKey: 'your-api-key-here' // Should be a valid Bright Data API key
});
Dataset ID Issues
// Verify your dataset ID exists and is correct
const triggerResponse = await client.triggerCollection({
dataset_id: 'your-dataset-id' // Should be a valid dataset ID
});
API Endpoint Issues
curl -I https://api.brightdata.com
Common Error Messages
Debugging Tips
The SDK throws errors with descriptive messages. Always wrap your calls in try-catch blocks:
try {
const results = await scrapeWebsite();
console.log(results);
} catch (error) {
console.error('Scraping failed:', error);
// Additional error details are logged automatically
}
MIT
FAQs
A simple Node.js SDK for the Bright Data API
We found that akbdsdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.