Skip to content
ChatfuelSDK
Deployment

Picking a host

Which host to run your app on, and the two rules that hold whichever one you pick.

Nothing about the app is Vercel-specific except vercel.json and api/chatfuel.ts; delete both and you have a working Node app. So the host you pick decides who manages TLS, whether you can serve from a sub-path and how long a WebSocket stays open — not what the code is.

Picking a host

VercelYour own serverDocker
Commandnpm run deploynpm run build && npm startdocker build + docker run
Needs an accountVercelnonenone
TLS, domainmanagedyoursyours
Sub-path (/app/)no, root onlyyesyes
WebSocket lifetimecapped by the function duration (300 s on Hobby); the client reconnectsunboundedunbounded
Where the env livesthe Vercel project (.env is never uploaded)your process--env-file and build args

All three run the same proxy source, so the auth gate, the bot fence and the error codes are identical between them.

Every host has to answer an unknown path with index.html

The router is path-based, so /deals/board is a real address. A host that 404s it produces a failure that looks like a routing bug and is not one: a reload of that URL fails while clicking through to the same page works fine.

  • Vercel — the last rewrite in vercel.json.
  • nginxtry_files $uri /index.html;
  • Static hosts — their SPA-fallback, or "rewrite everything to index.html".
  • The bundled Node server does it already.

The rule that catches everyone once

VITE_* variables are compiled into the browser bundle at build time. Everything else is read by the server at runtime. A deployment where those two disagree does not fail at the mismatch; it fails later, at the gate:

  • client built with Supabase, server started without it → the sign-in screen renders and every request comes back ProxyAuthMisconfigured or AuthSessionRequired;
  • server gated, client built without it → nobody is ever asked to sign in, and the server rejects everything.

Neither is fixable at runtime. Rebuild with the same values the server is running with.

The server prints its mode on startup, and /healthz answers {"ok":true,"auth":"on|off|misconfigured"}. Read that before any other symptom.

Deploying without the wizard

npm run deploy is a convenience, not a dependency: it is scripts/deploy-vercel.mjs inside your own project, driving the Vercel CLI. Any pipeline that builds the client, builds the server and sets the environment produces the same result, and any CI that can run npm run build can deploy this app.

On this page