
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socketโs new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
A comprehensive QR code generation framework with advanced features including dynamic QR codes, analytics, security, and customization
A comprehensive QR code generation framework with advanced features including dynamic QR codes, analytics, security, and extensive customization options.
npm install qrverse
import QRVerse from 'qrverse';
// Initialize QRVerse
const qrverse = new QRVerse({
baseUrl: 'https://your-domain.com',
analytics: {
enabled: true,
trackLocation: true,
trackDevice: true,
},
});
// Generate a simple QR code
const result = await qrverse.generateQR({
data: 'https://example.com',
size: 300,
});
console.log('QR Code generated:', result.id);
// result.qrCode contains the PNG buffer
const customQR = await qrverse.generateQR({
data: 'https://mywebsite.com',
type: 'static',
size: 400,
customization: {
foregroundColor: '#2C3E50',
backgroundColor: '#ECF0F1',
logo: {
src: './logo.png',
size: 60,
margin: 10,
},
frame: {
type: 'rounded',
color: '#3498DB',
thickness: 5,
},
dotStyle: 'circle',
shape: 'rounded',
},
});
const dynamicQR = await qrverse.generateQR({
data: 'https://changeable-destination.com',
type: 'dynamic',
security: {
password: 'mySecretPassword',
encryption: true,
encryptionKey: 'my-custom-key-32-chars-long',
},
expiration: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000), // 30 days
});
// Later, update the destination
await qrverse.updateDynamicQR(dynamicQR.id, 'https://new-destination.com');
// Get all available templates
const templates = qrverse.getTemplates();
// Use a pre-built template
const templateQR = await qrverse.generateQR({
data: 'https://business-site.com',
template: 'corporate-gray',
customization: {
logo: {
src: './company-logo.png',
size: 50,
},
},
});
// Get business-specific templates
const businessTemplates = qrverse.getBusinessTemplates();
const ticketQR = await qrverse.generateQR({
data: 'TICKET-12345',
singleUse: true,
template: 'golden-luxury',
expiration: new Date('2024-12-31T23:59:59Z'),
security: {
encryption: true,
},
});
const batchOptions = [
{ data: 'https://product1.com', template: 'modern-blue' },
{ data: 'https://product2.com', template: 'vibrant-sunset' },
{ data: 'https://product3.com', template: 'forest-green' },
];
const batchResults = await qrverse.generateBatch(batchOptions);
console.log(`Generated ${batchResults.length} QR codes`);
// Record a scan (typically called from your redirect endpoint)
const scanRecorded = await qrverse.recordScan(
qrId,
req.ip,
req.headers['user-agent']
);
// Get analytics for a specific QR code
const analytics = await qrverse.getAnalytics(qrId);
console.log({
totalScans: analytics.totalScans,
uniqueScans: analytics.uniqueScans,
scansByDate: analytics.scansByDate,
scansByLocation: analytics.scansByLocation,
scansByDevice: analytics.scansByDevice,
});
// Get top performers
const topQRs = await qrverse.getTopPerformers(10);
// Get scan trends
const trends = await qrverse.getScanTrends(30); // Last 30 days
// Get geographic distribution
const geoDistribution = await qrverse.getGeographicDistribution();
const qrverse = new QRVerse({
email: {
service: 'gmail', // or 'outlook', 'yahoo', etc.
user: 'your-email@gmail.com',
pass: 'your-app-password',
},
});
// Schedule a weekly report
qrverse.scheduleReport('weekly-report', {
frequency: 'weekly',
email: 'manager@company.com',
qrIds: ['qr1', 'qr2', 'qr3'], // Optional: specific QR codes
includeCharts: true,
});
// Generate immediate report
await qrverse.generateReport({
frequency: 'daily',
email: 'admin@company.com',
});
// Generate CSV export
const csvData = await qrverse.generateCSVReport({
frequency: 'monthly',
email: 'data@company.com',
});
QRVerse comes with 12+ pre-built templates:
// Create custom template
const customTemplate = qrverse.createCustomTemplate(
'my-brand',
'My Brand Template',
'Custom template for my brand',
{
gradient: {
type: 'linear',
colors: ['#FF6B6B', '#4ECDC4'],
direction: 45,
},
frame: {
type: 'rounded',
color: '#FF6B6B',
thickness: 4,
},
}
);
const protectedQR = await qrverse.generateQR({
data: 'Sensitive information',
security: {
password: 'strongPassword123',
},
});
// Verify password when scanning
const verifiedData = qrverse.verifyPassword(protectedData, 'strongPassword123');
const encryptedQR = await qrverse.generateQR({
data: 'Top secret data',
security: {
encryption: true,
encryptionKey: 'your-32-character-encryption-key',
},
});
// Decrypt data
const decryptedData = qrverse.decrypt(encryptedData, 'your-32-character-encryption-key');
interface QRVerseConfig {
baseUrl?: string; // Base URL for dynamic QR codes
database?: DatabaseConfig; // Database configuration
analytics?: {
enabled: boolean;
trackLocation: boolean;
trackDevice: boolean;
};
security?: {
defaultEncryption: boolean;
hashAlgorithm: string;
};
email?: EmailConfig; // Email configuration for reports
}
generateQR(options: QRCodeOptions): Promise<QRCodeResult>
Generate a QR code with specified options.
updateDynamicQR(id: string, newDestination: string): Promise<boolean>
Update the destination URL of a dynamic QR code.
recordScan(qrId: string, ip: string, userAgent: string): Promise<boolean>
Record a QR code scan for analytics.
getAnalytics(qrId: string): Promise<AnalyticsData | null>
Get comprehensive analytics for a QR code.
getTopPerformers(limit?: number): Promise<AnalyticsData[]>
Get the best performing QR codes.
getScanTrends(days?: number): Promise<Record<string, number>>
Get scan trends over time.
getTemplates(): Template[]
Get all available templates.
getTemplate(id: string): Template | null
Get a specific template by ID.
createCustomTemplate(id: string, name: string, description: string, customization: QRCustomization): Template
Create a custom template.
encrypt(data: string, key?: string): string
Encrypt data with optional custom key.
decrypt(encryptedData: string, key: string): string
Decrypt previously encrypted data.
verifyPassword(protectedData: string, password: string): string | null
Verify password for protected data.
npm test
npm run build
Check out our examples repository for complete implementation examples:
We welcome contributions! Please see our Contributing Guide for details.
git clone https://github.com/julioamorimdev/qrverse.git
cd qrverse
npm install
npm run dev
npm test
npm run test:coverage
We use ESLint and Prettier for code formatting:
npm run lint
npm run lint:fix
This project is licensed under the MIT License - see the LICENSE file for details.
See CHANGELOG.md for a detailed history of changes.
Made with โค๏ธ by the QRVerse Team
If you find QRVerse useful, please consider giving it a โญ on GitHub!
FAQs
A comprehensive QR code generation framework with advanced features including dynamic QR codes, analytics, security, and customization
We found that qrverse 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.
Product
Socketโs new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.