Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/auth-providers-setup/src/clerk/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export const handler = async ({ rwVersion, force: forceArg }: Args) => {
rwVersion,
forceArg,
provider: 'clerk',
webPackages: ['@clerk/clerk-react'],
apiPackages: ['@clerk/clerk-sdk-node'],
webPackages: ['@clerk/clerk-react', '@redwoodjs/auth-providers-web'],
apiPackages: ['@clerk/clerk-sdk-node', '@redwoodjs/auth-providers-api'],
notes: [
'You will need to add three environment variables with your Clerk URL, API key and JWT key.',
'Check out web/src/App.{js,tsx} for the variables you need to add.',
'Check out web/src/auth.{js,tsx} for the variables you need to add.',
'See also: https://redwoodjs.com/docs/authentication#clerk',
],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ import { ClerkLoaded, ClerkProvider, useUser } from '@clerk/clerk-react'
import { createClerkAuth } from '@redwoodjs/auth-providers-web'
import { navigate } from '@redwoodjs/router'

// You can set user roles in a "roles" array on the public metadata in Clerk.
//
// Also, you need to add three env variables: CLERK_FRONTEND_API_URL for web and
// CLERK_API_KEY plus CLERK_JWT_KEY for api. All three can be found under "API Keys"
// on your Clerk.dev dashboard.
//
// Lastly, be sure to add the key "CLERK_FRONTEND_API_URL" in your app's redwood.toml
// [web] config "includeEnvironmentVariables" setting.

export const { AuthProvider: ClerkRwAuthProvider, useAuth } = createClerkAuth()

interface Props {
Expand Down