Skip to main content

Configuration

PostKit uses a postkit.config.json file in your project root for configuration.

Basic Configuration

{
"db": {
"localDbUrl": "postgres://user:pass@localhost:5432/myapp_local",
"schemaPath": "db/schema",
"schema": "public",
"remotes": {
"dev": {
"url": "postgres://user:pass@dev-host:5432/myapp",
"default": true
},
"staging": {
"url": "postgres://user:pass@staging-host:5432/myapp"
}
}
}
}

Configuration Options

db.localDbUrl (required)

PostgreSQL connection URL for your local clone database.

db.schemaPath (optional)

Path to your schema files, relative to project root. Default: "db/schema".

db.schema (optional)

Database schema name. Default: "public".

db.remotes (required)

Named remote database configurations. At least one remote must be configured.

Remote Properties

PropertyTypeRequiredDescription
urlstringYesPostgreSQL connection URL
defaultbooleanNoMark as default remote (one must be default)
addedAtstringNoISO timestamp when remote was added (auto-set)

Environment Variables

For sensitive data like database passwords, use environment variables:

# .env file
DEV_DB_URL="postgres://user:pass@dev-host:5432/myapp"
STAGING_DB_URL="postgres://user:pass@staging-host:5432/myapp"

Then reference them in your config:

{
"db": {
"localDbUrl": "postgres://user:pass@localhost:5432/myapp_local",
"remotes": {
"dev": {
"url": "${DEV_DB_URL}",
"default": true
}
}
}
}

Auth Module Configuration

The auth module uses environment variables for Keycloak connections:

VariableDescriptionRequired
KC_SOURCE_URLSource Keycloak base URLYes
KC_SOURCE_ADMIN_USERSource admin usernameYes
KC_SOURCE_ADMIN_PASSSource admin passwordYes
KC_SOURCE_REALMRealm name to exportYes
KC_TARGET_URLTarget Keycloak base URLYes
KC_TARGET_ADMIN_USERTarget admin usernameYes
KC_TARGET_ADMIN_PASSTarget admin passwordYes

See Auth Configuration for more details.