🔧 WebMiner Advanced Integration

Compare development vs production builds and explore integration patterns

🏗️ Development Build Dev

Best for: Development, debugging, customization

/* Development integration - full documentation */ <script src="webminer.js" data-pool="wss://pool.example.com" data-wallet="YOUR_ADDRESS" data-throttle="0.25"> </script> /* Access detailed APIs for debugging */ console.log(PerformanceMonitor.getPerformanceReport()); console.log(MobileOptimizer.getOptimizationStatus());
Click buttons above to test development build...

⚡ Production Build Prod

Best for: Live websites, CDN deployment, performance

/* Production integration - optimized */ <script src="webminer.min.js" data-pool="wss://pool.example.com" data-wallet="YOUR_ADDRESS" data-throttle="0.25"> </script> /* Same APIs, smaller footprint */ WebMiner.start().then(success => { console.log('Mining:', success); });
Click buttons above to test production build...

📊 Build Comparison

Feature Development (webminer.js) Production (webminer.min.js)
File Size ~88 KB ~53 KB (40% smaller)
Load Time Slower (larger file) Faster (optimized)
Comments Full documentation License only
Debugging Human-readable code Optimized structure
API Access All APIs available All APIs available
Functionality 100% complete 100% complete
Browser Support Chrome 70+, Firefox 65+ Chrome 70+, Firefox 65+
CDN Ready Yes Optimized

🎯 Simple Integration Pattern

// Production: Simple script tag <script src="webminer.min.js" data-pool="wss://your-pool.com" data-wallet="YOUR_MONERO_ADDRESS" data-throttle="0.15" data-auto-start="false"></script>

🔧 Programmatic Control Pattern

// Advanced control with custom settings <script src="webminer.min.js"></script> <script> const miner = new WebMiner({ pool: 'wss://your-pool.com', wallet: 'YOUR_MONERO_ADDRESS', throttle: 0.20, enablePerformanceMonitoring: true, enableMobileOptimizations: true, autoStart: false }); // Custom consent handling document.getElementById('start-mining').onclick = async () => { const started = await miner.start(); if (started) { console.log('Mining started with consent'); updateMiningIndicator(true); } }; // Monitor performance setInterval(() => { if (miner.isMining()) { const stats = miner.getStats(); updateDashboard(stats); } }, 5000); </script>

📱 Mobile-Optimized Pattern

// Mobile-first configuration <script src="webminer.min.js"></script> <script> // Detect mobile and adjust settings const isMobile = /Mobi|Android|iPhone/i.test(navigator.userAgent); const miner = new WebMiner({ pool: 'wss://your-pool.com', wallet: 'YOUR_MONERO_ADDRESS', throttle: isMobile ? 0.10 : 0.25, // Lower for mobile enableMobileOptimizations: true, autoStart: false }); // Mobile-specific consent message if (isMobile) { MiningConsent.state.showMobileWarning = true; MiningConsent.state.pauseWhenHidden = true; } </script>

🛡️ Content Security Policy Pattern

/* CSP-compliant headers */ Content-Security-Policy: script-src 'self' 'unsafe-inline'; connect-src 'self' wss://your-pool.com; worker-src 'self' blob:; // CSP-safe initialization <script src="webminer.min.js" nonce="random123"></script> <script nonce="random123"> WebMiner.init({ pool: 'wss://your-pool.com', wallet: 'YOUR_ADDRESS' }); </script>

🚀 Performance Test Suite

Compare the performance characteristics of both builds:

Click buttons above to run performance tests...