OTPilot

Framework guide

Handle 2FA and OTP codes in Puppeteer automatically

Fetch the code and type it into the 2FA input in your Puppeteer script. OTPilot keeps the TOTP seed encrypted on its side; your Puppeteer agent only ever receives the current code, its expiry and the next code.

Puppeteer · javascript
// Log into Shopify with Puppeteer + OTPilot
const res = await fetch("https://otpilot.vibiz.app/api/v1/codes/shopify", {
  headers: { Authorization: `Bearer ${process.env.OTPILOT_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.message} Fix: ${data.error.fix}`);

await page.type('input[autocomplete="one-time-code"], input[name*="otp" i], input[name*="code" i]', data.code);
await page.keyboard.press("Enter");

Why not put the seed in your Puppeteer code?

Puppeteer 2FA guides by site

All 150 sites →

Try it with your own secret — no signup

Paste a TOTP secret on the home page and get a live code plus a working API call in seconds.