feat: wire up clerk
+ Add convex provider with clerk + Add clerk provider + Add account page + Add login page + Add sign up page + Add clerk middleware + Add Navbar component
This commit is contained in:
1 parent
8025858815
commit
9416bbaa05
9 files changed
+122
-4
No files matched your search
@@ -0,0 +1,25 @@
|
||||
'use client';
|
||||
|
||||
import { useAuth } from '@clerk/nextjs';
|
||||
import { ConvexReactClient } from 'convex/react';
|
||||
import { ConvexProviderWithClerk } from 'convex/react-clerk';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
const CONVEX_URL = process.env.NEXT_PUBLIC_CONVEX_URL;
|
||||
|
||||
if (CONVEX_URL === undefined) {
|
||||
throw Error('NEXT_PUBLIC_CONVEX_URL is undefined');
|
||||
}
|
||||
|
||||
const client = new ConvexReactClient(CONVEX_URL);
|
||||
|
||||
export default function ConvexProvider({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<ConvexProviderWithClerk
|
||||
client={client}
|
||||
useAuth={useAuth}
|
||||
>
|
||||
{children}
|
||||
</ConvexProviderWithClerk>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user