Skip to content

Commit

Permalink
Create clerk.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Pxl12 authored Aug 26, 2024
1 parent 3daac76 commit 3a1c005
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .env.local/clerk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
npm install @clerk/nextjs

NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_anVzdC1tYXN0b2Rvbi01LmNsZXJrLmFjY291bnRzLmRldiQ
CLERK_SECRET_KEY=pk_test_anVzdC1tYXN0b2Rvbi01LmNsZXJrLmFjY291bnRzLmRldiQ

import { clerkMiddleware } from "@clerk/nextjs/server";

export default clerkMiddleware();

export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
};
import {
ClerkProvider,
SignInButton,
SignedIn,
SignedOut,
UserButton
} from '@clerk/nextjs'
import './globals.css'
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<ClerkProvider>
<html lang="en">
<body>
<SignedOut>
<SignInButton />
</SignedOut>
<SignedIn>
<UserButton />
</SignedIn>
{children}
</body>
</html>
</ClerkProvider>
)
}

0 comments on commit 3a1c005

Please sign in to comment.