Skip to main content

Quick Start

ZeroDrop gives you a disposable email inbox in one line of code. No signup, no Docker, no SMTP config.

Install the SDK

npm install zerodrop-client

Generate an inbox

import { ZeroDrop } from 'zerodrop-client';

const mail = new ZeroDrop();
const inbox = mail.generateInbox();

console.log(inbox); // swift-x7k2m@zerodrop-sandbox.online
The inbox is ready instantly — no network request needed to generate it.

Wait for an email

const email = await mail.waitForLatest(inbox, { timeout: 30000 });

console.log(email.subject);   // "Verify your email"
console.log(email.otp);       // "123456" — auto-extracted
console.log(email.magicLink); // "https://..." — auto-extracted
waitForLatest uses SSE for sub-second delivery. Falls back to polling automatically if SSE is unavailable.

Full example

import { test, expect } from '@playwright/test';
import { ZeroDrop } from 'zerodrop-client';

const mail = new ZeroDrop();

test('user can sign up and verify email', async ({ page }) => {
  const inbox = mail.generateInbox();

  await page.goto('/signup');
  await page.fill('[data-testid="email"]', inbox);
  await page.click('[data-testid="submit"]');

  const email = await mail.waitForLatest(inbox, { timeout: 30000 });

  // OTP already extracted — no regex needed
  await page.fill('[data-testid="otp"]', email.otp!);
  await page.click('[data-testid="verify"]');

  await expect(page).toHaveURL('/dashboard');
});

Next steps