What We Shipped
We just released two things: a REST API for programmatic access to Mailloop, and a JavaScript SDK that wraps it nicely for Node.js and TypeScript projects.
The API covers the core operations you'd expect. Create and manage sandboxes, list and retrieve emails, work with temporary sandboxes for test isolation. Token distribution for authorization is ready in the app settings page.
The SDK
The JavaScript SDK is available on npm as @mailloop/sdk. It comes with full TypeScript support and zero dependencies. Here's a typical test workflow:
import { MailloopClient } from '@mailloop/sdk';
const client = new MailloopClient({
apiKey: process.env.MAILLOOP_API_KEY
});
// Create a temporary sandbox for a test
const sandbox = await client.sandboxes.createTemporary({
name: 'Integration Test',
duration: 60,
});
// Send email to sandbox.emailAddress via SMTP, then...
// Wait for it to arrive
const email = await client.emails.waitFor(sandbox.id, {
subject: 'Welcome Email',
timeout: 30000,
});
expect(email.html).toContain('Welcome to our service'); The waitFor method waits for matching emails with configurable timeout and filters. It's designed for test suites where you send an email and need to verify it arrived with the right content.
Real World Example: Our Status Page
We built our system status page using the SDK. It runs automated checks that create temporary sandboxes, send emails via SMTP, and verify delivery. The checks run every few minutes and we track latency over time.
Each check on the status page shows the actual code snippet used. If you want to see how the SDK performs in production, that's a live demonstration.