Deployment
Self-Hosted Quick Start
Deploy the full Banata platform on your own infrastructure.
This guide is for operators self-hosting Banata itself.
It is not a customer-app quickstart for embedding auth locally. Self-hosting Banata still means:
- deploy a Banata dashboard and backend
- sign in to that dashboard
- create a project
- create a project-scoped API key
- point apps at that self-hosted Banata instance with the same SDKs and frontend helpers
What You Are Deploying
The self-hosted stack keeps Banata's normal product shape:
- dashboard-first setup
- project-scoped API keys
- Banata-managed users, sessions, organizations, and templates
- Banata-managed email delivery and auth configuration
- app-side integration through
@banata-auth/sdk,@banata-auth/nextjs, and@banata-auth/react
Platform Runtime Files
The self-hosted platform still keeps a small amount of local Convex wiring:
convex/
|-- convex.config.ts
|-- auth.config.ts
|-- authNode.ts
|-- http.ts
`-- banataAuth/
|-- auth.ts
|-- adapter.ts
`-- schema.tsThe packaged component provides the component registration, packaged schema, and packaged migrations. The local banataAuth/ folder only keeps the files that still need deployment env, runtime config, or Convex codegen anchoring.
See Convex Integration for the exact file responsibilities.
Operator Setup
- Deploy the Banata dashboard app
- Deploy the Convex backend for that Banata instance
- Configure email providers and templates in the dashboard
- Sign in to the dashboard as an operator
- Create a project for the customer or internal app
- Create a project-scoped API key
At that point the app integration looks the same as hosted Banata.
App Integration Example
// src/lib/auth-server.ts
import { createBanataAuthServer } from "@banata-auth/nextjs/server";
export const {
handler,
isAuthenticated,
getToken,
preloadAuthQuery,
fetchAuthQuery,
fetchAuthMutation,
fetchAuthAction,
} = createBanataAuthServer({
convexUrl: process.env.NEXT_PUBLIC_CONVEX_URL!,
convexSiteUrl: process.env.NEXT_PUBLIC_CONVEX_SITE_URL!,
apiKey: process.env.BANATA_API_KEY!,
});// src/app/api/auth/[...all]/route.ts
import { handler } from "@/lib/auth-server";
export const { GET, POST, PUT, PATCH, DELETE } = handler;// src/lib/auth-client.ts
import { createAuthClient } from "@banata-auth/react/plugins";
export const authClient = createAuthClient({
baseURL: "/api/auth",
});Environment Variables
For the customer app:
NEXT_PUBLIC_CONVEX_URL=https://your-banata-instance.convex.cloud
NEXT_PUBLIC_CONVEX_SITE_URL=https://your-banata-instance.convex.site
NEXT_PUBLIC_SITE_URL=http://localhost:3000
BANATA_API_KEY=sk_test_your_project_keyFor the Banata platform deployment itself, follow:
Important Rule
Do not treat @banata-auth/convex as the normal first-run integration for customer apps.
Customer apps should not become usable auth runtimes just because someone copied local Convex config into their repo. Authentication is meant to start only after a Banata dashboard project exists and a project-scoped API key has been issued.