Configure environment variables
Copy the example env file and fill in your values:See Environment variables for a full reference of every variable.
Initialize Convex
Convex requires two steps — one for local development and one for production.Local developmentRun the Convex dev server to create a development deployment and push your schema:This writes Copy the production
NEXT_PUBLIC_CONVEX_URL and CONVEX_DEPLOYMENT to your .env.local automatically.Production deploymentWhen you are ready to go to production, deploy Convex to a production environment:NEXT_PUBLIC_CONVEX_URL output — you will need it in the next step.Deploy to Vercel
Install the Vercel CLI and deploy:Follow the prompts to link the project to your Vercel account. Vercel will detect Next.js automatically and configure the build settings.
Set environment variables in Vercel
After deploying, add all environment variables in the Vercel dashboard:
After saving, redeploy for the new variables to take effect:
- Open your project in the Vercel dashboard.
- Go to Settings → Environment Variables.
- Add each variable from your
.env.local, using the production values (production Convex URL, live Stripe keys, production Auth0 callback URL, etc.).
| Variable | Local value | Production value |
|---|---|---|
NEXT_PUBLIC_CONVEX_URL | Dev deployment URL | Production deployment URL |
STRIPE_SECRET_KEY | sk_test_... | sk_live_... |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | pk_test_... | pk_live_... |
AUTH0_CALLBACK_URL | http://localhost:3000/api/auth0/callback | https://yourdomain.com/api/auth0/callback |
Configure Stripe webhooks
Digcrate uses a Stripe webhook to process subscription events (checkout completed, subscription updated, invoice paid, etc.).
- In the Stripe dashboard, go to Developers → Webhooks.
- Click Add endpoint.
- Set the endpoint URL to
https://yourdomain.com/api/webhooks/stripe. - Select the following events to listen for:
checkout.session.completedcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
- Copy the Signing secret and set it as
STRIPE_WEBHOOK_SECRETin Vercel.
If you are not enabling subscription billing, you can skip this step. All users will be on the free tier.
Configure Auth0 Token Vault (connected services)
If you want to enable Spotify, Slack, and Google Docs integrations, configure Auth0:
- In the Auth0 dashboard, create a new application of type Regular Web Application.
- Under Settings, add your production callback URL to Allowed Callback URLs:
- Enable the Token Vault feature under Connections and configure the Spotify, Slack, and Google OAuth connections.
- Copy the Domain, Client ID, and Client Secret from the Auth0 application settings and set them as environment variables in Vercel.
Auth0 Token Vault is optional. Skip this step if you do not need Spotify, Slack, or Google Docs integration.
Verify the deployment
Open your Vercel deployment URL and:
- Sign up for an account — Clerk should handle the flow and redirect you to the workspace.
- Run a test query (e.g.
/artist Radiohead) — the agent should stream a response. - If you configured Stripe, visit
/pricingand verify the plans appear. - Check the Convex dashboard to confirm data is being written to the database.