Configuration
Customize Typebase with the typebase.json configuration file.
Last updated on
Typebase uses a typebase.json file in your project root to store configuration. init creates it with a $schema reference and nothing else, so every option starts on its default. Other CLI commands update it as you go, and you can edit it manually.
Example
{
"$schema": "https://raw.githubusercontent.com/typebase-io/monorepo/refs/heads/main/apps/cli/src/helpers/typebase.schema.json",
"projectPath": "src/lib/typebase/server/",
"serverProvider": "vercel",
"server": {
"output": "ts",
"adapter": "node",
"outDir": "_server"
}
}Reference
projectPath
The path to your typebase/ directory, relative to the project root.
| Type | Default |
|---|---|
string | "src/typebase" if a src/ directory exists, otherwise "typebase" |
{
"projectPath": "src/lib/typebase/server/"
}This tells the CLI where to find your db/, actions/, auth.ts, env.ts, publisher.ts, and _generated/ files.
serverProvider
The deployment provider to use with npx typebase-io-cli deploy.
| Type | Options |
|---|---|
string | "vercel", "cloudflare", "deno" |
{
"serverProvider": "vercel"
}If not set, the CLI will ask you to choose a provider on the first deploy and save it here.
server
Configuration for npx typebase-io-cli generate-server. These are the defaults used when you don't pass CLI flags.
{
"server": {
"output": "ts",
"adapter": "node",
"outDir": "_server",
"port": 8080
}
}server.output
The output format for generated server files.
| Type | Options | Default |
|---|---|---|
string | "ts", "esm", "cjs" | "ts" |
"ts": TypeScript source files (you compile them yourself)"esm": JavaScript withimport/exportsyntax"cjs": JavaScript withrequire/module.exportssyntax
server.adapter
The HTTP adapter for the generated server.
| Type | Options | Default |
|---|---|---|
string | "node", "bun", "hono", "fastify", "deno", "cloudflare" | "node" |
server.outDir
The output directory for generated server files, relative to your typebase/ directory.
| Type | Default |
|---|---|
string | "_server" |
server.port
The port the generated server listens on.
| Type | Default |
|---|---|
number | 8080 |
vercel
Vercel deployment configuration. Managed automatically by the CLI after your first deploy to Vercel.
{
"vercel": {
"projectId": "prj_abc123",
"projectName": "my-typebase-server",
"orgId": "team_xyz789"
}
}| Field | Description |
|---|---|
projectId | Your Vercel project ID |
projectName | Your Vercel project name |
orgId | Your Vercel team/org ID (optional) |
cloudflare
Cloudflare Workers deployment configuration. Managed automatically by the CLI.
{
"cloudflare": {
"accountId": "abc123",
"workerName": "my-typebase-server",
"subdomain": "my-subdomain"
}
}| Field | Description |
|---|---|
accountId | Your Cloudflare account ID |
workerName | The name of your Cloudflare Worker |
subdomain | Your *.workers.dev subdomain |
deno
Deno Deploy configuration. Managed automatically by the CLI.
{
"deno": {
"org": "my-org",
"projectId": "abc123",
"slug": "my-typebase-server"
}
}| Field | Description |
|---|---|
org | Your Deno Deploy organization |
projectId | Your Deno Deploy project ID |
slug | Your project slug (used in the URL) |
neon
Neon database configuration. Managed automatically by the CLI when you use a database.
{
"neon": {
"orgId": "org-abc123",
"projectId": "proj-xyz789"
}
}| Field | Description |
|---|---|
orgId | Your Neon organization ID |
projectId | Your Neon project ID |
Full schema
Here is the complete typebase.json schema with all optional fields:
{
"projectPath": "typebase",
"serverProvider": "vercel",
"server": {
"output": "ts",
"adapter": "node",
"outDir": "_server"
},
"vercel": {
"projectId": "",
"projectName": "",
"orgId": ""
},
"cloudflare": {
"accountId": "",
"workerName": "",
"subdomain": ""
},
"deno": {
"org": "",
"projectId": "",
"slug": ""
},
"neon": {
"orgId": "",
"projectId": ""
}
}All fields are optional. The CLI will use sensible defaults and prompt you interactively when needed. Alongside them, the $schema key written by
init points at this schema so your editor can autocomplete and validate the file; the CLI keeps it in place whenever it updates the config.