---
title: "Puppeteer | Proxy Mail QA"
description: "A Puppeteer script that signs up with a disposable Proxy Mail QA address and enters the verification code from the email, using the proxymail-qa package."
url: https://proxymail.qa/docs/puppeteer
---

# Puppeteer

Install the [Node.js client](https://proxymail.qa/docs/node) next to Puppeteer, and set the [API key](https://proxymail.qa/docs/api-keys) as `PROXYMAIL_QA_API_KEY`:

Terminal window

```bash
npm install --save-dev puppeteer proxymail-qa
```

signup.mjs

```js
import puppeteer from 'puppeteer';
import { ProxyMailQA } from 'proxymail-qa';

const qa = new ProxyMailQA(); // reads PROXYMAIL_QA_API_KEY
const browser = await puppeteer.launch();
const page = await browser.newPage();

const { address, password } = await qa.createAddress({ persona: true, password: true });
await page.goto('https://staging.example.com/signup');
await page.type('input[name=email]', address);
await page.type('input[name=password]', password);

const submitted = new Date();
await Promise.all([page.waitForNavigation(), page.click('button[type=submit]')]);

const { value: code } = await qa.waitForCode(address, { since: submitted });
await page.type('input[name=code]', code);
await Promise.all([page.waitForNavigation(), page.click('button[type=submit]')]);

await qa.deleteAddress(address);
await browser.close();
```

For a link instead of a code, `const { value: link } = await qa.waitForLink(address, { type: 'verify', since: submitted })` and `await page.goto(link)`. If nothing arrives, the error says why as far as Proxy Mail QA can tell, for example that your app’s email provider only sends to verified addresses.

The same calls work with Jest or Vitest around them; see [Running in CI](https://proxymail.qa/docs/ci) for keys and parallel runs.

[Previous Cypress](https://proxymail.qa/docs/cypress.html) [Next Python](https://proxymail.qa/docs/python.html)
