Skip to content
v2.7

The owbase.json file

The site and function fields in owbase.json, a complete example, what push overwrites on the server and how to generate the file with pull, in CI too.

owbase.json lives at the root of the project folder and goes into Git along with the code. The CLI creates it (owbase init project), adds resources to it (owbase init site, owbase init function), updates it with what is on the server (owbase pull) and applies it on the server (owbase push). This page covers sites and functions; tables and buckets are in Database and Storage.

{
"projectId": "<PROJECT_ID>",
"projectName": "My shop",
"sites": [
{
"$id": "shop",
"name": "Shop",
"path": "sites/shop",
"framework": "astro",
"logging": true,
"timeout": 30,
"buildRuntime": "node-22",
"adapter": "static",
"installCommand": "npm ci",
"buildCommand": "npm run build",
"outputDirectory": "./dist",
"fallbackFile": "",
"startCommand": "",
"deploymentRetention": 30
}
],
"functions": [
{
"$id": "orders",
"name": "orders",
"runtime": "node-22",
"path": "functions/orders",
"entrypoint": "src/main.js",
"execute": ["any"],
"enabled": true,
"logging": true,
"events": [],
"schedule": "",
"interval": 0,
"timeout": 15,
"commands": "npm install",
"scopes": [],
"ignore": ["node_modules", ".npm"],
"deploymentRetention": 0
}
]
}
Field What
projectId the project ID. In CI, OWBASE_PROJECT_ID overrides this value
projectName the project name, for reading only
endpoint optional; the API address, when it is not the default (https://cloud.owbase.dev/v1)
Field What
$id the site ID
name the name shown in the console
path the site folder, relative to owbase.json. It exists only here: the server doesn’t store it
framework the framework (astro, nextjs, other…). It can’t change after creation
adapter static (ready-made files) or ssr (the framework’s Node server)
buildRuntime the Node version of the build (node-22 or node-24)
installCommand the install command (npm ci, npm install)
buildCommand the build command (npm run build)
outputDirectory the build’s output folder (./dist; ./ = the root of what was uploaded)
fallbackFile the fallback file of a single-page site (index.html); empty = no fallback
startCommand the SSR start command; empty = the framework’s
timeout the maximum time of an SSR response, in seconds
logging false removes the details from the access logs
deploymentRetention days to keep inactive deployments; 0 = keep all; a new site starts at 30
buildSpecification, runtimeSpecification optional; the build machine and the SSR one. Without them, the plan’s applies
ignore optional, local only: extra patterns to leave out of the package (as in .gitignore)
Field What
$id, name, path as in the site
runtime the runtime (node-22 or node-24). It can’t change after creation
entrypoint the file that exports the function, relative to the folder
commands the build command (npm install)
execute who can execute: ["any"] = anyone; [] = only an API key
events events that trigger the function
schedule a schedule in cron format; empty = no schedule
interval minutes between scheduled executions (instead of schedule)
timeout the maximum time of an execution, in seconds
enabled false turns the function off
logging false removes the details from the execution logs
scopes scopes of the key the execution receives; [] = no scopes
deploymentRetention, buildSpecification, runtimeSpecification, ignore as in the site
previewDomainTarget, previewDomainLabel the <name>.fn.owbase.dev address the push maintains; the pull fills them in

owbase push site (and push function) creates the resource if it doesn’t exist. If it exists, owbase.json wins over the console: the push writes to the server every field from the tables above that is in the file, except path and ignore, which are local only. A change made in the console that is not in the file is undone on the next push.

Before writing, the push checks the site’s framework (the function’s runtime): if it differs from the server’s, it stops with Framework mismatch and changes nothing.

A missing field doesn’t stay as it was. The CLI doesn’t send the field, and the server uses the default value:

Site, missing field Becomes
installCommand, buildCommand, outputDirectory, fallbackFile, startCommand, adapter empty
timeout 30
logging on
deploymentRetention unchanged (new site: 30 days)
runtimeSpecification the plan’s default
buildRuntime, buildSpecification as it was
Function, missing field Becomes
execute, events, scopes empty (without execute, no one executes without a key)
schedule, commands empty
timeout 15
enabled, logging on
deploymentRetention 0
entrypoint, interval, buildSpecification, runtimeSpecification as it was

Two things always apply:

  • On and Git: the push doesn’t send the site’s enabled or Git fields, and the server (since 2.7.2-owbase.7) keeps both as they are: a site turned off in the console stays off, and a site connected to Git stays connected.
  • Variables: they only change with --with-variables, which replaces all of them with those in the folder’s .env.

So keep the file complete: after changing something in the console, run owbase pull before the next push. --no-code applies only the settings, without a deployment.

Terminal window
owbase pull site --site-id shop --no-code
owbase pull function --function-id orders --no-code

The pull reads the site (or the function) on the server and writes its entry to owbase.json, with all the fields above. The entry is replaced whole: a local-only field, such as ignore, is dropped; the path already in the file stays. Without --no-code, the pull also downloads the code of the latest deployment to the folder (and asks first; without a terminal, only with --force).

The pull works with just the API key, without a login (see CI with an API key). Without an owbase.json in the folder, with OWBASE_PROJECT_ID set, it creates the file with the projectId and the requested resource.

Was this page helpful?