Team Commsvendor:slackEmail OTPUnwrapped Magic LinkCloud KMS TOTP
Automate Slack Confirmation Codes (ABC-123) & Magic Links in Playwright
Automate Slack alphanumeric 6-character codes (A4B-9K2), confirmation magic links, and KMS TOTP for workspace and enterprise grid agents.
1. 60-Second Gmail & Outlook Auto-Forwarding Filter
Don't want to change your existing account email on Slack? Keep your corporate inbox on Slack and forward only verification emails to <identity-slug>@in.sentryrelay.com. Sentry Relay's Stage 2 unwrapper preserves the original Slack sender header automatically (full setup guide).
# Paste into Gmail -> Settings -> Filters -> Create a new filter ("Has the words")
from:(slack.com) ("confirmation code" OR "verification code" OR "sign in to Slack" OR "magic link")
# Action: Forward it to -> <your-identity-slug>@in.sentryrelay.com2. Copy-Paste Slack 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('Automate Slack workspace login with alphanumeric code or magic link', async ({ page }) => {
await page.goto('https://slack.com/signin#/signin');
await page.fill('input[data-qa="signin_email_input"]', 'slack-bot@in.sentryrelay.com');
await page.click('button[data-qa="submit_button"]');
// Slack sends codes like "A4B-9K2" (preserved) or "482-910" (normalized)
const auth = await relay.wait('slack-bot', {
channel: 'email',
sender: 'slack.com',
timeout: 30,
});
if (auth.event?.otpCode) {
const clean = auth.event.otpCode.replace('-', '');
await page.fill('input[aria-label*="digit"], input[data-qa="confirmation_code_input"]', clean);
} else if (auth.event?.magicLink) {
await page.goto(auth.event.magicLink);
}
await expect(page).toHaveURL(/app\.slack\.com/);
});3. Slack Production Gotchas
Alphanumeric Codes (`A4B-9K2`) Break Numeric-Only Extractors
Generic regexes like `\d{6}` completely miss Slack's alphanumeric confirmation codes (`A4B-9K2`). `vendor:slack` preserves alphanumeric codes in uppercase while normalizing pure numeric codes.
Workspace Unread Message Digests Ignored
Forwarding rules or shared inboxes with Slack unread message notifications won't trigger false matches because `vendor:slack` disqualifies unread digests and billing statements.
Human-Fallback Safety Bridge™ Integration
Ironically, you can also point Sentry Relay's `fallbackWebhookUrl` *at* a Slack Incoming Webhook so non-auth SMS or voice alerts sent to your agency's phone numbers notify your ops channel.