TypebaseTypebase

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

typebase.json
{
  "$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.

TypeDefault
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.

TypeOptions
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.

TypeOptionsDefault
string"ts", "esm", "cjs""ts"
  • "ts": TypeScript source files (you compile them yourself)
  • "esm": JavaScript with import/export syntax
  • "cjs": JavaScript with require/module.exports syntax

server.adapter

The HTTP adapter for the generated server.

TypeOptionsDefault
string"node", "bun", "hono", "fastify", "deno", "cloudflare""node"

server.outDir

The output directory for generated server files, relative to your typebase/ directory.

TypeDefault
string"_server"

server.port

The port the generated server listens on.

TypeDefault
number8080

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"
  }
}
FieldDescription
projectIdYour Vercel project ID
projectNameYour Vercel project name
orgIdYour 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"
  }
}
FieldDescription
accountIdYour Cloudflare account ID
workerNameThe name of your Cloudflare Worker
subdomainYour *.workers.dev subdomain

deno

Deno Deploy configuration. Managed automatically by the CLI.

{
  "deno": {
    "org": "my-org",
    "projectId": "abc123",
    "slug": "my-typebase-server"
  }
}
FieldDescription
orgYour Deno Deploy organization
projectIdYour Deno Deploy project ID
slugYour 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"
  }
}
FieldDescription
orgIdYour Neon organization ID
projectIdYour 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.

On this page