This sample app showcases how to implement authentication in your Convex application using Descope.
Here's what happens when a user interacts with the authentication flow:
AuthProvider now recognizes the user as authenticated.ConvexProviderWithDescope fetches an auth token from Descope.ConvexReactClient passes this token down to your Convex backend to validate.ConvexProviderWithDescope manages token refetching as needed to maintain user authentication with your backend.Upon landing, users encounter a Log in button. Once authenticated:
numbers table.Setting up the app involves a few additional steps due to the authentication feature:
.env.local.example to a .env.local file with your specific values:CONVEX_DEPLOYMENT=dev:<Your Convex Project>
NEXT_PUBLIC_CONVEX_URL= <Your Convex URL>
NEXT_PUBLIC_DESCOPE_PROJECT_ID="<Your Descope Project ID>"
NEXT_PUBLIC_ISSUER_URL="<Your Issuer URL>"
NEXT_PUBLIC_ISSUER_URL: can be found in your Descope Console under the Applications page and editing the active application
NEXT_PUBLIC_DESCOPE_PROJECT_ID in Convex as well.yarn install
After these steps, you're set to sign in and explore the application!
Once you've configured your app, you're ready to run it:
yarn dev
This command starts the Next.js development server, making your app accessible at http://localhost:3000.
If you encounter any issues or have questions, consult the Grafbase and Descope documentation, or reach out to our support for assistance.
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have suggestions or improvements.
This sample app is open-source and available under the MIT License. See the LICENSE file for more details.
$ claude mcp add descope-convex \
-- python -m otcore.mcp_server <graph>