Skip to content
Merged
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
8 changes: 7 additions & 1 deletion docs/guides/development/integrations/databases/convex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ With [Convex](https://www.convex.dev/), you can build a backend with a provided
<Tab>
The following example demonstrates how to configure Clerk and Convex's providers. Clerk's [`useAuth()`](/docs/reference/hooks/use-auth) hook must be passed to Convex's `<ConvexProviderWithClerk>` and Clerk's `<ClerkProvider>` must be wrapped around it.

```ts {{ filename: 'src/main.tsx', mark: [[5, 7], 19, 21] }}
```ts {{ filename: 'src/main.tsx', mark: [[5, 7], 25, 27] }}
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
Expand All @@ -164,6 +164,12 @@ With [Convex](https://www.convex.dev/), you can build a backend with a provided
throw new Error('Add your Clerk Publishable Key to the .env file')
}

if (!process.env.VITE_CONVEX_URL) {
throw new Error('Missing VITE_CONVEX_URL in your .env file')
}

const convex = new ConvexReactClient(process.env.VITE_CONVEX_URL)

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
Expand Down