# How to use disposable email in your CI/CD pipeline for E2E testing

With Humanless, each test in the pipeline creates its own disposable inbox, uses the address in your app, waits for the email with one long-poll call that returns the parsed code or link, and deletes the inbox in teardown. Store the API key as a CI secret (`HUMANLESS_API_KEY`). One inbox per test keeps parallel jobs and retries from reading each other's mail, and passing `since` (a timestamp taken just before the send) keeps resends from returning an old code. `withIdentity` in the TypeScript SDK handles the create and delete for you, including when a test fails. Pay-as-you-go accounts can create 30 identities per hour (Starter 100, Team 300, Scale 1,000), so for larger suites reuse an identity across a spec or save the login state.

```ts fixtures.ts
import { test as base } from "@playwright/test";
import { Humanless, type Identity } from "humanless";

export const hl = new Humanless({ apiKey: process.env.HUMANLESS_API_KEY! });

export const test = base.extend<{ inbox: Identity }>({
  inbox: async ({}, use) => {
    const identity = await hl.createIdentity({ channels: ["email"] });
    await use(identity);
    await hl.deleteIdentity(identity.identity_id).catch(() => {});
  },
});
```

## Other options

- **Mailpit as a service container** in GitHub Actions or GitLab CI, with your app's SMTP pointed at it.
- **The Gmail API** with plus-addressing, if your staging environment must send real email and you can't add a service.
- **Mailosaur or MailSlurp**: hosted inbox APIs with CI examples.

> **Use policy:** Only for apps you own or are authorized to test. See the [Terms](/terms).

More: [How to test email OTP and verification codes](/guides/playwright-email-otp) · [All answers](/answers/)

Last updated 2026-12-04

Canonical: https://usehumanless.com/answers/how-to-use-disposable-email-in-your-ci-cd-pipeline-for-e2e-testing

---
More: https://usehumanless.com/llms.txt
