Skip to content
Config File

Config File

The config.json file stores server configuration.

Location

  • Windows: %APPDATA%\ziri\config.json
  • macOS/Linux: ~/.ziri/config.json
  • Docker: /data/config.json (when CONFIG_DIR=/data)

File Structure

config.json
{
	"mode": "local",
	"server": {
		"host": "127.0.0.1",
		"port": 3100
	},
	"publicUrl": "",
	"email": {
		"enabled": false,
		"provider": "smtp",
		"options": {
			"smtp": {
				"host": "smtp.example.com",
				"port": 587,
				"secure": false,
				"auth": {
					"user": "user@example.com",
					"pass": "password"
				}
			}
		},
		"fromByProvider": {
			"smtp": "noreply@example.com"
		}
	},
	"logLevel": "info"
}

Fields

mode

Server mode: "local" or "live".

  • local - Local mode (default)
  • live - Backend API + External PDP

server

Server binding configuration.

  • host - Host to bind to (default: 127.0.0.1)
  • port - Port to listen on (default: 3100)

Note: Changes require server restart.

publicUrl

Public URL where users can access ZIRI. Used in:

  • Email notifications
  • API responses
  • SDK default URL

Example: "https://ziri.example.com"

email

Email service configuration.

Enabled: Set enabled: true to enable email.

Provider: "smtp", "sendgrid", "mailgun", "ses", or "manual".

SMTP:

config.json
{
	"enabled": true,
	"provider": "smtp",
	"options": {
		"smtp": {
			"host": "smtp.example.com",
			"port": 587,
			"secure": false,
			"auth": {
				"user": "user@example.com",
				"pass": "password"
			}
		}
	},
	"fromByProvider": {
		"smtp": "noreply@example.com"
	}
}

SendGrid:

config.json
{
	"enabled": true,
	"provider": "sendgrid",
	"options": {
		"sendgrid": {
			"apiKey": "SG.your-api-key"
		}
	},
	"fromByProvider": {
		"sendgrid": "noreply@example.com"
	}
}

logLevel

Logging level: "debug", "info", "warn", "error".

Default: "info".

Default Config

If no config file exists, ZIRI uses these defaults:

config.json
{
	"mode": "local",
	"server": {
		"host": "127.0.0.1",
		"port": 3100
	},
	"publicUrl": "",
	"email": {
		"enabled": false
	},
	"logLevel": "info"
}

Updating Config

Via UI

Use the Config page in the admin UI. Changes are saved automatically.

Via API

curl -X POST http://localhost:3100/api/config \
  -H "Authorization: Bearer your-token" \
  -H "Content-Type: application/json" \
  -d '{
    "server": {
      "port": 3101
    }
  }'

Via File

Edit config.json directly. Restart the server for server settings to take effect.

Validation

ZIRI validates the config file on load. Invalid config causes startup to fail with an error message.

Next Steps