Skip to content

crafter-station/clerk-plapi-2

Repository files navigation


clerk-plapi-2

Built with Crafter Station Discord Twitter

About

A demo app showcasing Clerk's Platform API capabilities. Provisioned entirely via PLAPI - the CLI-first approach to Clerk authentication.

Tech Stack

  • Framework: Next.js 15
  • Styling: Tailwind CSS
  • Components: shadcn/ui
  • Auth: Clerk (provisioned via PLAPI)
  • Linting: Biome
  • Runtime: Bun

Getting Started

bun install
bun dev

Open http://localhost:3000 in your browser.

Scripts

Command Description
bun dev Start development server
bun build Build for production
bun start Start production server
bun lint Run Biome linter
bun test Run Playwright tests
bun test:ui Run tests in UI mode
bun test:headed Run tests with visible browser

Proxy Configuration

This app uses Clerk's Frontend API proxy for production. The proxy configuration:

  1. Middleware (src/proxy.ts): Forwards /__clerk/* requests to https://frontend-api.clerk.dev
  2. ClerkProvider (src/app/layout.tsx): Sets proxyUrl prop
  3. Environment: NEXT_PUBLIC_CLERK_PROXY_URL=https://clerk-plapi-2.crafter.run/__clerk

Important: After deployment, configure the Proxy URL in Clerk Dashboard → Domains → Advanced

Agent Tasks Testing

Agent Tasks allow creating pre-authenticated sessions for testing and automation.

Setup

# Copy environment template
cp .env.example .env.local

# Add your Clerk keys and test user ID
# Get TEST_USER_ID from Clerk Dashboard → Users

Run Tests

# Install Playwright browsers (first time only)
bun playwright install chromium

# Run all tests
bun test

# Run with visible browser
bun test:headed

# Interactive mode
bun test:ui

agent-browser Integration

Test Agent Tasks with agent-browser:

# Authenticate as user and open in browser
./scripts/agent-browser-clerk.sh user_123 https://clerk-plapi-2.crafter.run

# With visible browser
./scripts/agent-browser-clerk.sh user_123 https://clerk-plapi-2.crafter.run --headed

Requires CLERK_SECRET_KEY environment variable.

Deployment

Deployed on Vercel at clerk-plapi-2.crafter.run

Post-deployment: Configure Proxy URL in Clerk Dashboard (see Proxy Configuration above)

License

MIT

Releases

No releases published

Packages

 
 
 

Contributors

Languages