Mailwurf

Quickstart

From a new account to a test that reads a real email.

Create an account

Sign up in the dashboard, confirm your email, and name your organization. The organization owns every API key and inbox.

Create an API key

Open API keys, enter a name such as local or GitHub Actions, and select Create API key. Copy the key right away; it is shown once.

Use a separate key per environment. See API keys.

Install the package

npm install --save-dev @mailwurf/e2e

@mailwurf/e2e is ESM-only and needs Node 18 or later.

Set the key

.env.test
MAILWURF_API_KEY=mw_live_…

The package calls https://api.mailwurf.io. It reads no environment variables; the test passes the key to createMailwurf().

Write the test

tests/signup.spec.ts
import { expect, test } from "@playwright/test";
import { createMailwurf } from "@mailwurf/e2e";

const mailwurf = createMailwurf(process.env.MAILWURF_API_KEY!); // API key (mw_live_…) from Dashboard → API keys

test("confirms signup from the inbox", async ({ page }) => {
  const inbox = await mailwurf.createInbox();

  await page.goto("/signup");
  await page.getByLabel("Email").fill(inbox.address);
  await page.getByRole("button", { name: "Sign up" }).click();

  const mail = await inbox.waitFor({ subject: "Confirm", timeout: 15_000 });
  const link = mail.links.find((url) => url.includes("/confirm"));
  expect(link).toBeDefined();

  await page.goto(link!);
  await expect(page.getByText("confirmed")).toBeVisible();
});

The app sends the mail through its normal provider. Mailwurf receives it on MX and the wait returns as soon as it is stored.

Next

  • Messages: pick the right link and read one-time codes.
  • CI: run the same test in GitHub Actions.
  • Troubleshooting: timeouts, 401, and bounced mail.

On this page