/clerk:oauth-providersfrom clerk
Configures OAuth authentication providers for Clerk, including Google, GitHub, Discord, Apple, and 15+ more. Provides setup scripts, redirect URL generation, and integration patterns for Next.js and React.
Ships in clerk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill provides complete OAuth provider configuration for Clerk-powered applications. It covers all 19+ supported OAuth providers with templates, setup scripts, testing utilities, and integration patterns for Next.js, React, and other frameworks.
Tier 1 (Most Common):
Tier 2 (Social & Professional):
Tier 3 (Specialized):
Configure any OAuth provider with automated setup:
# Set up single provider
bash scripts/setup-provider.sh google
# Set up multiple providers
bash scripts/setup-provider.sh google github discord
# Interactive setup with prompts
bash scripts/setup-provider.sh --interactive
What the Script Does:
Output:
Generate callback URLs for all environments:
# Generate for specific provider
bash scripts/generate-redirect-urls.sh google
# Generate for all configured providers
bash scripts/generate-redirect-urls.sh --all
# Export to environment file
bash scripts/generate-redirect-urls.sh google --export > .env.oauth
Redirect URL Patterns:
Development:
http://localhost:3000/api/auth/callback/google
Production:
https://yourdomain.com/api/auth/callback/google
Clerk Default:
https://your-clerk-domain.clerk.accounts.dev/v1/oauth_callback
Validate OAuth configuration end-to-end:
# Test single provider
bash scripts/test-oauth-flow.sh google
# Test all providers
bash scripts/test-oauth-flow.sh --all
# Generate test report
bash scripts/test-oauth-flow.sh google --report
Tests Performed:
Access pre-configured templates for each provider:
Google OAuth:
// templates/google/clerk-config.ts
import { google } from '@clerk/clerk-sdk-node';
export const googleConfig = {
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
redirectUri: process.env.GOOGLE_REDIRECT_URI,
scopes: ['profile', 'email'],
// Google-specific options
accessType: 'offline',
prompt: 'consent'
};
GitHub OAuth:
// templates/github/clerk-config.ts
export const githubConfig = {
clientId: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
redirectUri: process.env.GITHUB_REDIRECT_URI,
scopes: ['read:user', 'user:email'],
// GitHub-specific options
allowSignup: true
};
Discord OAuth:
// templates/discord/clerk-config.ts
export const discordConfig = {
clientId: process.env.DISCORD_CLIENT_ID,
clientSecret: process.env.DISCORD_CLIENT_SECRET,
redirectUri: process.env.DISCORD_REDIRECT_URI,
scopes: ['identify', 'email'],
// Discord-specific options
permissions: '0'
};
React/Next.js Components:
// templates/oauth-shared/AuthButtons.tsx
import { SignIn } from '@clerk/nextjs';
export function AuthButtons() {
return (
<div className="auth-providers">
<SignIn.Root>
<SignIn.Step name="start">
<div className="provider-buttons">
<SignIn.Strategy name="oauth_google">
<button>Continue with Google</button>
</SignIn.Strategy>
<SignIn.Strategy name="oauth_github">
<button>Continue with GitHub</button>
</SignIn.Strategy>
<SignIn.Strategy name="oauth_discord">
<button>Continue with Discord</button>
</SignIn.Strategy>
</div>
</SignIn.Step>
</SignIn.Root>
</div>
);
}
Clerk Dashboard Configuration:
// templates/oauth-shared/clerk-dashboard-config.ts
export const oauthProviders = [
{
provider: 'google',
enabled: true,
clientId: 'GOOGLE_CLIENT_ID',
clientSecret: 'GOOGLE_CLIENT_SECRET',
scopes: ['profile', 'email']
},
{
provider: 'github',
enabled: true,
clientId: 'GITHUB_CLIENT_ID',
clientSecret: 'GITHUB_CLIENT_SECRET',
scopes: ['read:user', 'user:email']
},
{
provider: 'discord',
enabled: true,
clientId: 'DISCORD_CLIENT_ID',
clientSecret: 'DISCORD_CLIENT_SECRET',
scopes: ['identify', 'email']
}
];
# 1. Set up Google OAuth
bash scripts/setup-provider.sh google
# Follow prompts:
# - Create OAuth app in Google Cloud Console
# - Configure authorized redirect URIs
# - Copy Client ID and Client Secret
# - Add to Clerk Dashboard
# 2. Generate redirect URLs
bash scripts/generate-redirect-urls.sh google --export > .env.google
# 3. Test OAuth flow
bash scripts/test-oauth-flow.sh google
# 4. Add to React app
cp templates/google/clerk-config.ts ./lib/auth/google.ts
cp templates/oauth-shared/AuthButtons.tsx ./components/auth/
Result: Fully configured Google OAuth with sign-in button and tested flow
# Set up all providers
for provider in google github discord; do
bash scripts/setup-provider.sh $provider
done
# Generate all redirect URLs
bash scripts/generate-redirect-urls.sh --all --export > .env.oauth
# Test all providers
bash scripts/test-oauth-flow.sh --all --report
# Deploy multi-provider UI
cp templates/oauth-shared/AuthButtons.tsx ./components/auth/
Result: Users can sign in with Google, GitHub, or Discord
# Set up enterprise providers
bash scripts/setup-provider.sh microsoft linkedin
# Configure enterprise-specific scopes
# Edit templates/microsoft/clerk-config.ts to add Azure AD scopes
# Edit templates/linkedin/clerk-config.ts for LinkedIn API v2
# Test enterprise flows
bash scripts/test-oauth-flow.sh microsoft --report
bash scripts/test-oauth-flow.sh linkedin --report
Result: Enterprise authentication with Microsoft 365 and LinkedIn integration
# Set up gaming providers
bash scripts/setup-provider.sh discord twitch
# Configure gaming-specific permissions
# Discord: guild membership, voice state
# Twitch: user:read:email, channel subscriptions
# Test gaming provider flows
bash scripts/test-oauth-flow.sh discord twitch
Result: Gaming platform authentication with Discord and Twitch integration
Environment Variables:
CLERK_PUBLISHABLE_KEY - Clerk public keyCLERK_SECRET_KEY - Clerk secret keyGOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET)Dependencies:
@clerk/clerk-sdk-node - Clerk Node.js SDK@clerk/nextjs - Clerk Next.js integration (for Next.js apps)@clerk/clerk-react - Clerk React components (for React apps)Clerk Project Setup:
For Each OAuth Provider:
CRITICAL: When generating any configuration files or code:
NEVER hardcode actual API keys or secrets
NEVER include real credentials in examples
NEVER commit sensitive values to git
ALWAYS use placeholders: your_service_key_here
ALWAYS create .env.example with placeholders only
ALWAYS add .env* to .gitignore (except .env.example)
ALWAYS read from environment variables in code
ALWAYS document where to obtain keys
Placeholder format: {provider}_{env}_your_key_here
Example:
# .env.example (safe to commit)
GOOGLE_CLIENT_ID=google_dev_your_client_id_here
GOOGLE_CLIENT_SECRET=google_dev_your_client_secret_here
# .env (NEVER commit)
GOOGLE_CLIENT_ID=actual_client_id_from_google_cloud
GOOGLE_CLIENT_SECRET=actual_secret_from_google_cloud
Documentation: templates/google/SETUP.md
Required Scopes:
profile - User profile informationemail - Email addressopenid - OpenID ConnectDocumentation: templates/github/SETUP.md
Required Scopes:
read:user - Read user profileuser:email - Access user email addressesDocumentation: templates/discord/SETUP.md
Required Scopes:
identify - User identityemail - Email addressguilds - Server list (optional)Documentation: templates/microsoft/SETUP.md
Required Scopes:
openid - OpenID Connectprofile - User profileemail - Email addressUser.Read - Microsoft Graph APIDocumentation: templates/apple/SETUP.md
Required Scopes:
name - User nameemail - Email addressMulti-Provider Strategy:
Redirect URL Management:
Scope Configuration:
Error Handling:
Testing:
Security:
Redirect URI Mismatch:
Invalid Client Credentials:
Scope Authorization Failed:
Token Exchange Error:
User Profile Retrieval Failed:
Plugin: clerk Version: 1.0.0 Category: Authentication Skill Type: Configuration Providers Supported: 19+
examples/enterprise-sso-setup.md (opens in a new tab)examples/gaming-platform-oauth.md (opens in a new tab)examples/multi-provider-setup.md (opens in a new tab)examples/oauth-button-component.tsx (opens in a new tab)scripts/generate-redirect-urls.sh (opens in a new tab)scripts/setup-provider.sh (opens in a new tab)scripts/test-oauth-flow.sh (opens in a new tab)templates/apple/clerk-config.ts (opens in a new tab)templates/discord/clerk-config.ts (opens in a new tab)templates/facebook/clerk-config.ts (opens in a new tab)templates/github/clerk-config.ts (opens in a new tab)templates/google/clerk-config.ts (opens in a new tab)templates/linkedin/clerk-config.ts (opens in a new tab)templates/microsoft/clerk-config.ts (opens in a new tab)templates/oauth-shared/AuthButtons.tsx (opens in a new tab)templates/oauth-shared/clerk-dashboard-config.ts (opens in a new tab)templates/twitter/clerk-config.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vanman2024/ai-dev-marketplace --plugin clerk10 skills in this plugin
/api-authenticationBackend API authentication patterns with Clerk JWT middleware and route protection. Use when building REST APIs, GraphQL APIs, protecting backend routes, implementing JWT validation, setting up Express middleware, or when user mentions API authentication, backend security, JWT tokens, or protected endpoints./auth-componentsPre-built and custom Clerk authentication component templates with theming and customization patterns. Use when building authentication UI, creating sign-in/sign-up pages, customizing Clerk components, implementing user buttons, theming auth flows, or when user mentions Clerk components, SignIn, SignUp, UserButton, auth UI, appearance customization, or authentication theming./billing-integrationClerk Billing and Stripe subscription management setup. Use when implementing subscriptions, configuring pricing plans, setting up billing, adding payment flows, managing entitlements, or when user mentions Clerk Billing, Stripe integration, subscription management, pricing tables, payment processing, or monetization./middleware-protectionRoute protection and authorization patterns for Clerk middleware. Use when implementing route guards, protecting API routes, configuring middleware matchers, setting up role-based access control, creating auth boundaries, or when user mentions middleware, route protection, auth guards, protected routes, public routes, matcher patterns, or authorization middleware./nextjs-integrationComplete Next.js integration patterns for Clerk authentication with App Router and Pages Router. Use when setting up Clerk in Next.js, configuring authentication middleware, implementing protected routes, setting up server/client components with auth, or when user mentions Clerk Next.js setup, App Router auth, Pages Router auth, or Next.js authentication integration./organization-managementImplement Clerk multi-tenant organization features with RBAC, role-based access control, organization switching, member management, and tenant isolation. Use when building multi-tenant SaaS applications, implementing organization hierarchies, configuring custom roles and permissions, setting up organization-scoped data isolation, or when user mentions organizations, RBAC, multi-tenancy, roles, permissions, organization switcher, member management, or tenant isolation.Other plugins' skills for the same job