Cloud & Infravendor:cloudflareEmail OTPUnwrapped Magic LinkCloud KMS TOTP

Automate Cloudflare Dashboard 2FA & OTP in Playwright & Stagehand

Automate Cloudflare Dashboard 2FA authentication codes, verification links, and KMS TOTP while filtering out billing and DDoS alert digests.

Curated Stage 4 Extractor Profile (vendor:cloudflare)

Matches both `cloudflare.com` and `notify.cloudflare.com` 6-digit authentication/login codes and `dash.cloudflare.com` verification links while disqualifying billing invoices, DDoS attack mitigated notices, and weekly analytics digests.

Matched Sender Domains
cloudflare.comnotify.cloudflare.com
Login URL example: https://dash.cloudflare.com/login
Filtered Non-Auth Noise
  • Billing invoice notifications
  • DDoS attack mitigated alerts & weekly analytics

1. 60-Second Gmail & Outlook Auto-Forwarding Filter

Don't want to change your existing account email on Cloudflare? Keep your corporate inbox on Cloudflare and forward only verification emails to <identity-slug>@in.sentryrelay.com. Sentry Relay's Stage 2 unwrapper preserves the original Cloudflare sender header automatically (full setup guide).

# Paste into Gmail -> Settings -> Filters -> Create a new filter ("Has the words")
from:(cloudflare.com OR notify.cloudflare.com) ("authentication code" OR "verification code" OR "login code")

# Action: Forward it to -> <your-identity-slug>@in.sentryrelay.com

2. Copy-Paste Cloudflare 2FA Automation Snippets

Choose your browser automation stack below. All snippets resolve codes in <200ms with Upstash Redis 15-second lookback protection so arrived-before-wait race conditions never fail a run.

import { test, expect } from '@playwright/test';
import { SentryRelay } from '@sentryrelay/sdk';

const relay = new SentryRelay({ apiKey: process.env.SENTRY_RELAY_API_KEY! });

test('Cloudflare Dashboard login with Email OTP or TOTP', async ({ page }) => {
  await page.goto('https://dash.cloudflare.com/login');
  await page.fill('input[name="email"]', process.env.CF_EMAIL!);
  await page.fill('input[name="password"]', process.env.CF_PASSWORD!);
  await page.click('button[type="submit"]');

  // Check if Cloudflare requires Email Auth Code (new IP/device) or TOTP
  const emailCodeInput = page.locator('input[name="emailCode"]');
  if (await emailCodeInput.isVisible({ timeout: 5000 }).catch(() => false)) {
    const auth = await relay.wait('cf-infra-bot', {
      channel: 'email',
      sender: 'cloudflare.com',
      timeout: 30,
    });
    await emailCodeInput.fill(auth.event!.otpCode!);
    await page.click('button[type="submit"]');
  }

  const totpInput = page.locator('input[name="twoFactorToken"]');
  if (await totpInput.isVisible({ timeout: 4000 }).catch(() => false)) {
    const token = await relay.totp.get('cf-infra-bot', 'cloudflare_totp');
    await totpInput.fill(token.code);
    await page.click('button[type="submit"]');
  }

  await expect(page).toHaveURL(/dash\.cloudflare\.com/);
});

3. Cloudflare Production Gotchas

Frequently Asked Questions

Does sender="cloudflare.com" also match notify.cloudflare.com?
Yes. Both sender filtering (substring match) and the vendor:cloudflare Stage 4 rule cover cloudflare.com and notify.cloudflare.com.
Can Sentry Relay handle Cloudflare Zero Trust OTP gates?
Yes. Cloudflare Access / Zero Trust email PINs are matched deterministically via Stage 4/Stage 5 and returned in <200ms.
How fast does Cloudflare email verification resolve?
Once the email hits Cloudflare Email Routing into Sentry Relay, extraction and Redis Pub/Sub wake-up complete in under 200ms p95.
Provision an Isolated Identity for Cloudflare

Start free in 3 minutes with 2 isolated @in.sentryrelay.com Identities, 250 monthly email extractions, and Cloud KMS TOTP vaulting.