Production Deployment
Follow this guide to set up your production environment. Tijori requires Clerk for authentication and Convex for its realtime backend.
- Clerk Account & Production Instance
- Convex Account
- Vercel Account (for frontend)
- A production domain (recommended)
CONVEX_DEPLOY_KEYpublicly. This key allows full administrative access to your database.Configure Clerk Authentication
Clerk handles identity management and secure session tokens for Tijori.
1. Create a Production Instance
In your Clerk dashboard, navigate to your application and ensure you are in the Production environment settings.
Generate your production keys, and since convex doesn't support *.vercel.app domains, you have to use your own domain, setup your records, for detailed guide, check the offical Clerk docs
2. Obtain API Keys
Copy these keys into your local .env.prod and your Vercel environment variables.
VITE_CLERK_PUBLISHABLE_KEY=pk_live_...
CLERK_SECRET_KEY=sk_live_...
CLERK_JWKS_FIELD=https://clerk.custom.domain/.well-known/jwks.json
CLERK_JWT_ISSUER_DOMAIN=https://clerk.custom.domain
Initialize Convex Backend
Convex powers the database, serverless functions, and real-time synchronization.
Before deploying, make sure your schema is synced with Clerk. Once, your schema is in sync, generate the keys from the production instance via dashboard or from Deployment Settings
# Once logged in, deloy schema to convex
bun run cvx:deploy
# All production keys
CONVEX_DEPLOYMENT=cultured-man-99
VITE_CONVEX_URL=https://cultured-man-99.convex.cloud
CONVEX_DEPLOY_KEY=prod:cultured-man-99|abc123...
Deploy Frontend to Vercel
The final step is to host the React application and connect it to your backend.
For detailed guide, on deployment not only to vercel but also to any other platform, check the offical Convex Deployment Guide
bun run build:verceldistAdd these to Vercel Project Settings:
- CONVEX_DEPLOYMENT
- VITE_CONVEX_URL
- CONVEX_DEPLOY_KEY
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
- CLERK_SECRET_KEY
- CLERK_JWT_ISSUER_DOMAIN
- CLERK_JWKS_FIELD
Troubleshooting
"Unauthorized" errors in Convex
CLERK_JWT_ISSUER_DOMAIN is not set correctly in Convex or if the Clerk instance is not in production mode. Verify the environment variable in Convex via bunx convex env list.Variables not decrypting in production
crypto.subtle. Ensure your hosting provider isn't injecting overly restrictive headers.