-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy pathREADME.md.clerk
More file actions
51 lines (32 loc) · 1.54 KB
/
Copy pathREADME.md.clerk
File metadata and controls
51 lines (32 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Clerk Authentication Setup
This project uses [Clerk](https://clerk.com/) for authentication. Follow these steps to set up Clerk in your local development environment:
## Setup Instructions
1. **Install Dependencies**
The project already includes `@clerk/nextjs` in the package.json. Run the following command to install all dependencies:
```bash
npm install
```
2. **Environment Variables**
Create a `.env.local` file in the root of the project with the following variables:
```
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_publishable_key_here
CLERK_SECRET_KEY=your_secret_key_here
```
You can get these keys from your Clerk dashboard after creating a project.
3. **Clerk Configuration**
The project is already configured with Clerk:
- `middleware.ts` at the root of the project uses `clerkMiddleware()` from `@clerk/nextjs/server`
- `app/layout.tsx` wraps the application with `<ClerkProvider>`
- The Navbar component uses Clerk authentication UI components (`SignInButton`, `SignUpButton`, `UserButton`)
4. **Start the Development Server**
```bash
npm run dev
```
5. **Testing Authentication**
Once the development server is running, you can test the authentication by:
- Clicking the Sign In or Sign Up buttons in the navbar
- Creating an account or signing in
- After signing in, you should see the UserButton in the navbar
## Additional Resources
- [Clerk Documentation](https://clerk.com/docs)
- [Clerk Next.js Quickstart](https://clerk.com/docs/quickstarts/nextjs)