Node.js Client
The official Node.js SDK for VaultSandbox Gateway. It handles quantum-safe encryption automatically, letting you focus on testing email workflows.
Key Capabilities
Section titled “Key Capabilities”- Automatic Encryption: ML-KEM-768 key encapsulation + AES-256-GCM encryption handled transparently
- Real-Time Delivery: SSE-based email delivery with smart polling fallback
- Webhooks: HTTP callbacks for email events with filtering and templates
- Email Authentication: Built-in SPF/DKIM/DMARC validation helpers
- Full Email Access: Decrypted content, headers, links, and attachments
- Chaos Engineering: Simulate SMTP failures, latency, greylisting, and network issues
- TypeScript Support: Comprehensive type definitions included
Requirements
Section titled “Requirements”- Node.js 20+ (not supported in browsers or edge runtimes)
- VaultSandbox Gateway server
- Valid API key
Gateway Server
Section titled “Gateway Server”The SDK connects to a VaultSandbox Gateway - a receive-only SMTP server you self-host. It handles email reception, authentication validation, and encryption. You can run one with Docker in minutes.
See Gateway Overview or jump to Quick Start to deploy one.
Quick Example
Section titled “Quick Example”import { VaultSandboxClient } from '@vaultsandbox/client';
const client = new VaultSandboxClient({ url: 'https://gateway.example.com', apiKey: 'your-api-key',});
// Create inbox (keypair generated automatically)const inbox = await client.createInbox();
// Send email to inbox.emailAddress from your application...
// Wait for emailconst email = await inbox.waitForEmail({ timeout: 30000 });
console.log('Subject:', email.subject);console.log('Text:', email.text);
// Cleanupawait inbox.delete();Next Steps
Section titled “Next Steps”- Installation - Install the SDK
- Configuration - Client options and setup
- Core Concepts - Inboxes, emails, and authentication
- Webhooks - Set up webhook notifications
- Chaos Engineering - Test email resilience with failure simulation
- API Reference - Full API documentation