Skip to main content
Use otp.fromUri(...) when a flow needs a current MFA code.
import { otp } from "@qawolf/testkit";

const code = otp.fromUri(process.env["OTP_URI"]!);

await page.getByLabel("Verification code").fill(code);
await page.getByRole("button", { name: "Verify" }).click();
The input is the same otpauth:// URI used by authenticator apps.
const code = otp.fromUri(
  "otpauth://totp/QA%20Wolf:qa%40example.com?secret=JBSWY3DPEHPK3PXP&issuer=QA%20Wolf",
);
This helper is pure. It does not require runner wiring. For exported helper and type details, see the Core Reference.
Last modified on April 24, 2026