
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 powerful Node.js package for generating high-quality images using Microsoft's DALL-E 3 through Bing Image Creator. Create stunning AI-generated artwork with a simple, professional API.
A powerful Node.js package for generating high-quality images using Microsoft's DALL-E 3 through Bing Image Creator. Create stunning AI-generated artwork with a simple, professional API.
npm install dalle3
import DalleClient from 'dalle3';
// Initialize with your cookie string
const dalle = new DalleClient('YOUR_FULL_COOKIE_STRING_HERE', { verbose: true });
// Generate image links
const links = await dalle.generate('A majestic dragon soaring over a medieval castle at sunset', 'links');
console.log('🖼️ Generated images:', links);
// Generate and download files
const files = await dalle.generate('A futuristic robot playing chess', 'files');
console.log(`💾 Downloaded ${files.length} image files`);
You need a Microsoft account for this to work. Follow these steps carefully:
F12 or Ctrl+Shift+I)allow pasting and press Enter// Extract only the necessary cookies - copy this entire block
const requiredCookies = ['MUID', 'ANON', '_U', 'MSPTC', 'ak_bmsc', '_RwBf', '_SS', 'SRCHUSR', 'SRCHUID', 'SRCHHPGUSR'];
const cookieObj = {};
document.cookie.split(';').forEach(cookie => {
const [name, value] = cookie.trim().split('=');
if (requiredCookies.includes(name)) {
cookieObj[name] = value;
}
});
Object.keys(cookieObj).map(key => `${key}=${cookieObj[key]}`).join('; ');
MUID=7ACD4F29D1287E634A1BC987D56F8B2C; ANON=B; _U=9Ks82Ylo3Vw7DbQT2nXpGJmHeLZ8p5kUYraTq-m2083r4FtXcZw1hOVn6LsFeD715jtz; MSPTC=test456; ak_bmsc=2C7731F59DA284B65C3AEF9D7C4F92E1~111111111111; _RwBf=s; _SS=SID=demo123; SRCHUSR=DOB=20231225; SRCHUID=V=2&GUID=xyz789; SRCHHPGUSR=SRCHLANG=fr
MUID, ANON, _U, MSPTC: Authentication and session managementak_bmsc, _RwBf: Anti-bot and security validation_SS, SRCHUSR, SRCHUID, SRCHHPGUSR: Search personalization and session continuity// Use only the filtered cookie string from step 2
const cookieString = "MUID=...; ANON=...; _U=...; MSPTC=..."; // Your filtered cookies here
const dalle = new DalleClient(cookieString);
const dalle = new DalleClient(cookieString, options);
Parameters:
cookieString (string): Your complete Bing cookie string (see setup guide above)options (object, optional):
verbose (boolean): Enable detailed console logging (default: false)tempDir (string): Directory for temporary file downloads (default: './temp')generate(prompt, format, verbose)Generate images from a text prompt.
Parameters:
prompt (string): Text description of the image to generateformat (string): Output format - 'links' or 'files' (default: 'links')verbose (boolean, optional): Override verbose logging for this callReturns:
filename and data (base64) propertiesgenerateLinks(prompt)Convenience method to generate image links only.
generateFiles(prompt)Convenience method to generate image files as base64.
setVerbose(verbose)Enable or disable verbose logging.
setTempDir(tempDir)Set the temporary directory for file downloads.
import DalleClient from 'dalle3';
// Initialize with your filtered cookie string (10 cookies only)
const cookieString = "MUID=...; ANON=...; _U=...; MSPTC=..."; // Your filtered cookies here
const dalle = new DalleClient(cookieString, { verbose: true });
try {
// Generate stunning image links
const spaceImages = await dalle.generate(
'A breathtaking view of Earth from a space station with aurora borealis',
'links'
);
console.log('🌌 Space images:', spaceImages);
// Download images as base64 files
const robotImages = await dalle.generate(
'A friendly robot gardener tending to colorful flowers in a sunny garden',
'files'
);
robotImages.forEach((file, index) => {
console.log(`🤖 Image ${index + 1}: ${file.filename} (${Math.round(file.data.length/1024)}KB)`);
});
} catch (error) {
console.error('❌ Generation failed:', error.message);
}
import DalleClient from 'dalle3';
async function generateWithRetry(prompt, maxRetries = 3) {
const dalle = new DalleClient(process.env.BING_COOKIES);
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
console.log(`🎯 Attempt ${attempt}: Generating images...`);
const images = await dalle.generateLinks(prompt);
console.log(`✅ Success! Generated ${images.length} images`);
return images;
} catch (error) {
console.log(`❌ Attempt ${attempt} failed: ${error.message}`);
switch (error.code) {
case 'VALIDATION_ERROR':
console.log('🔍 Check your prompt and parameters');
return null; // Don't retry validation errors
case 'CONTENT_BLOCKED_ERROR':
console.log('🚫 Content blocked - try a different prompt');
if (attempt === maxRetries) return null;
break;
case 'NETWORK_ERROR':
console.log('🌐 Network issue - retrying...');
if (attempt < maxRetries) {
await new Promise(resolve => setTimeout(resolve, 2000 * attempt));
}
break;
case 'GENERATION_ERROR':
console.log('⚡ Generation failed - retrying with different approach...');
break;
default:
console.log('❓ Unknown error - retrying...');
}
}
}
console.log('💥 All attempts failed');
return null;
}
// Usage
const images = await generateWithRetry('A magical forest with glowing mushrooms');
import DalleClient from 'dalle3';
// Quiet mode for production
const productionClient = new DalleClient(cookieString, {
verbose: false,
tempDir: '/var/tmp/dalle-images'
});
// Development mode with detailed logging
const devClient = new DalleClient(cookieString, {
verbose: true,
tempDir: './debug-images'
});
// Runtime configuration changes
devClient.setVerbose(false); // Turn off logging
devClient.setTempDir('./new-temp-dir'); // Change temp directory
// Convenience methods
const landscapes = await devClient.generateLinks('Mountain landscape at golden hour');
const portraits = await devClient.generateFiles('Professional headshot of a CEO');
const dalle = new DalleClient(cookieString, { verbose: true });
// Artistic styles
const artworks = await dalle.generateLinks('Van Gogh style painting of a modern cityscape');
// Photorealistic scenes
const photos = await dalle.generateLinks('Professional photograph of a cozy coffee shop interior, warm lighting, 4K');
// Fantasy and sci-fi
const fantasy = await dalle.generateLinks('Epic dragon battle in a stormy sky, fantasy art, detailed');
// Abstract and conceptual
const abstract = await dalle.generateLinks('Abstract representation of music and colors flowing together');
// Architecture and design
const architecture = await dalle.generateLinks('Modern minimalist house with large glass windows, surrounded by forest');
| Error Type | Description | Solution |
|---|---|---|
ValidationError | Invalid input parameters | Check prompt and format parameters |
GenerationError | Image generation failed | Try different prompt or retry |
NetworkError | Network/connection issues | Check internet connection, retry |
ContentBlockedError | Content violates Bing policies | Modify prompt to be more appropriate |
AuthenticationError | Invalid/expired cookies | Refresh your cookie string |
FileSystemError | File operation failures | Check temp directory permissions |
❌ "Authentication Error"
# Your cookies have expired or are invalid
# Solution: Get fresh cookies using the guide above
❌ "Content Blocked"
# Your prompt violates content policy
# Solution: Try more general, appropriate language
❌ "Network Error"
# Connection issues or rate limiting
# Solution: Wait a moment and retry, check internet connection
// ✅ DO: Store cookies in environment variables
const dalle = new DalleClient(process.env.BING_COOKIES);
// ❌ DON'T: Hard-code cookies in source code
const dalle = new DalleClient("MUID=abc123..."); // Never do this!
// ✅ DO: Use only required cookies (reduces detection risk)
// Our extraction script automatically filters to safe cookies
// ❌ DON'T: Use all browser cookies (may trigger bot detection)
// ✅ Good prompts are specific and descriptive
"Professional portrait of a business woman in a modern office, natural lighting, sharp focus"
// ✅ Include style and quality keywords
"Watercolor painting of a sunset over mountains, soft brushstrokes, artistic"
// ❌ Avoid vague or potentially problematic prompts
"Person doing something"
// ✅ Use appropriate logging levels
const dalle = new DalleClient(cookies, { verbose: process.env.NODE_ENV === 'development' });
// ✅ Handle errors gracefully
try {
const images = await dalle.generateLinks(prompt);
} catch (error) {
logger.error(`Image generation failed: ${error.message}`);
return fallbackImages;
}
dalle3/
├── src/
│ ├── DalleClient.js # Main client class
│ ├── BingImageGenerator.js # Core generation logic
│ └── utils/
│ ├── Logger.js # Colored console logging
│ └── Errors.js # Custom error types
├── examples/
│ └── basic-usage.js # Usage examples
├── index.js # Package entry point
├── package.json # Package configuration
└── README.md # This file
MIT
FAQs
A powerful Node.js package for generating high-quality images using Microsoft's DALL-E 3 through Bing Image Creator. Create stunning AI-generated artwork with a simple, professional API.
We found that dalle3 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.