Playwright Auth (Clerk)

Generate Clerk sign-in tokens to authenticate Playwright tests.

2|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/george11642/george-plugins --skill playwright-auth-clerk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Playwright Auth (Clerk)
Source: https://github.com/george11642/george-plugins/tree/main/plugins/george-setup/skills/playwright-auth
Command: npx skills add https://github.com/george11642/george-plugins --skill playwright-auth-clerk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Authenticate Playwright tests against Clerk-based apps by automating sign-in token generation and session restoration, eliminating password downtime and flaky logins.

Core Features & Use Cases

  • Generate Clerk sign-in tokens programmatically for test users.
  • Sign in, wait for Clerk JS readiness, and restore authenticated state across tests.
  • Optional: warm Convex JWT cache to reduce auth races in CI.

Quick Start

Run the Playwright auth setup to generate a Clerk sign-in token and save an authenticated state for tests.

Frequently Asked Questions about Playwright Auth (Clerk)

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate Playwright tests with Clerk without using passwords or MFA?

Authenticating Playwright tests with Clerk without passwords or MFA is done by programmatically generating Clerk sign-in tokens. This bypasses CAPTCHA and password prompts, allowing you to retrieve tokens from the Clerk API and establish a seamless login session for end-to-end testing.

What do I need to set up Clerk authentication for Playwright end-to-end testing?

To set up Clerk authentication for Playwright testing, you need a CLERK_SECRET_KEY, an existing Clerk user account, and an application that loads Clerk JS on the frontend. These prerequisites allow the test runner to retrieve tokens and wait for session readiness.

Can I reuse authenticated Clerk state across multiple Playwright test cases?

Yes, you can reuse authenticated Clerk state across multiple Playwright test cases. The process generates a Clerk sign-in token, waits for Clerk JS readiness, and saves the authenticated state, enabling you to restore the session for subsequent tests without repeating the login flow.

Why does my Playwright end-to-end test fail due to auth races in CI with Convex JWT?

Auth races in CI with Convex JWT occur when tests proceed before the authentication cache is fully populated. You can reduce these races by optionally warming the Convex JWT cache after generating the Clerk sign-in token, ensuring the authenticated state is fully ready before tests execute.

What is the best way to automate Clerk sign-in for test automation?

The best way to automate Clerk sign-in for test automation is to use the Clerk API to programmatically generate sign-in tokens. This approach eliminates flaky logins and password downtime by bypassing manual authentication steps like MFA and CAPTCHA.

Does this Playwright Clerk authentication approach work if my app does not load Clerk JS on the frontend?

No, this approach requires the application to load Clerk JS on the frontend. The authentication process depends on waiting for Clerk JS readiness to restore the authenticated state and successfully apply the generated sign-in tokens in the browser environment.