Skip to main content
This is the recommended production path for Nudgra Cloud. Host the Next.js app on Vercel and run backend state, auth, scheduling, and webhooks on Convex Cloud.

Prerequisites

Before you start, prepare:
  • A Convex account.
  • A Vercel account.
  • A public app domain, such as https://cloud.nudgra.example.com.
  • Google OAuth credentials.
  • Meta app credentials and a webhook verify token.

Choose the app domain

Pick the final public URL for the Next.js app:
https://your-app-domain.com
Use that exact value everywhere:
  • Vercel SITE_URL.
  • Convex production SITE_URL.
  • Meta OAuth redirect URI.
  • Google authorized JavaScript origin.
  • Tracked-link testing.
If the domain changes later, update all platform settings and redeploy.

Create the Convex production deployment

1

Create the deployment

Create or open your Convex project. Create a production deployment from the Convex dashboard.
2

Generate a deploy key

Generate a production deploy key from the Convex dashboard. You will set it as CONVEX_DEPLOY_KEY on Vercel.
3

Save the site URL

Keep the production deployment’s .convex.site URL handy. You need it for Google OAuth and Meta webhooks.
You can also open the dashboard from the project root:
npx convex dashboard

Provision Convex Auth

Run this from the project root:
npx @convex-dev/auth --prod
When prompted:
  • Set SITE_URL to your public app domain, such as https://your-app-domain.com.
  • Let the tool generate and store JWT_PRIVATE_KEY and JWKS.
This prepares the production Convex deployment for Google sign-in and redirects back to your app after auth.

Configure Convex production

Set the email allowlist:
npx convex env set --prod NUDGRA_ALLOWED_EMAILS your-google-email@gmail.com
Set the public app origin:
npx convex env set --prod SITE_URL https://your-app-domain.com
After Google and Meta setup, also set:
npx convex env set --prod AUTH_GOOGLE_ID your-google-client-id
npx convex env set --prod AUTH_GOOGLE_SECRET your-google-client-secret
npx convex env set --prod META_APP_ID your-instagram-app-id
npx convex env set --prod META_APP_SECRET your-instagram-app-secret
npx convex env set --prod META_VERIFY_TOKEN your-random-verify-token

Deploy on Vercel

1

Import the repository

Import the Nudgra Cloud repository into Vercel.
2

Set the install command

npm install
3

Set the build command

npx convex deploy --cmd "npm run build"
4

Set Vercel environment variables

CONVEX_DEPLOY_KEY=your-convex-production-deploy-key
SITE_URL=https://your-app-domain.com
META_APP_ID=your-instagram-app-id
META_APP_SECRET=your-instagram-app-secret
META_VERIFY_TOKEN=your-random-webhook-verify-token
5

Attach the production domain

Attach the final domain in Vercel, then redeploy after the domain and environment variables are final.
The build command deploys the Convex backend, typechecks and bundles Convex functions, and injects the correct Convex deployment URLs into the Next.js build.

Smoke test production

After the first deployment:
  1. Open https://your-app-domain.com.
  2. Sign in with a Google account listed in NUDGRA_ALLOWED_EMAILS.
  3. Open /dashboard/account.
  4. Connect an Instagram professional account.
  5. Confirm the account appears as connected.
  6. Send a real test DM, comment, or story reply.
  7. Verify that contacts, conversations, automations, and logs update in the dashboard.
  8. Verify that tracked links resolve through your app domain.
  9. Verify that webhook activity appears in logs.

Update a deployment

For Vercel, push to the branch connected to the project and let the build run. You can also deploy from the project root:
npx convex deploy --cmd "npm run build"