Skip to content

Configuration

Complete instancez.yaml schema reference. Every key, type, default, and example.

instancez.yaml is the single source of truth for your project. On boot, the server diffs it against the live database and applies migrations automatically.

Env vars are interpolated using ${VAR} or ${VAR:-default}. They are resolved at load time; references are never stored in the database.

KeyTypeRequiredDescription
versionintegeryesSchema version. Currently 1.
KeyTypeDefaultDescription
project.namestringDisplay name shown in the dashboard.
project.descriptionstringOptional project description.
project.cloud.project_idstringCloud project ID. Written automatically by inz cloud deploy --new; not meant to be hand-edited.
KeyTypeDefaultDescription
database.pool.maxinteger20Maximum connections in the request pool.
database.pool.mininteger5Minimum idle connections.
database.pool.idle_timeoutduration300sHow long idle connections are held before closing.
KeyTypeDefaultDescription
server.portinteger8080HTTP listen port.
server.max_body_sizestring1MBMaximum request body size for non-upload endpoints.
server.max_limitinteger100Not currently enforced. Configuration value is defined but not validated on REST queries. Default query limit is 20.

Methods, headers, credentials, and preflight caching are fixed platform defaults — origins is the only knob, matching Supabase’s own gateway.

KeyTypeDefaultDescription
server.cors.originsstring[][]Allowed origins. Use ["*"] to allow all.
KeyTypeDefaultDescription
server.timeouts.requestduration30sPer-request deadline.
server.timeouts.db_queryduration10sPer-query deadline.
server.timeouts.uploadduration5mDeadline for file upload requests.
server.timeouts.shutdownduration30sGraceful shutdown window.

Duration strings use Go format: 30s, 5m, 1h.

KeyTypeDefaultDescription
providers.email.typestringEmail provider type. Currently "resend" or "ses".
providers.email.api_keystringProvider API key. Supports ${VAR}.
providers.email.default_from_emailstringDefault sender address.

Set providers.email: null to disable email sending.

KeyTypeDefaultDescription
providers.storage.typestring"local" or "s3".
providers.storage.pathstring(local only) Directory for local file storage.
providers.storage.bucketstring(s3 only) S3 bucket name.
providers.storage.regionstring(s3 only) AWS region.
providers.storage.access_key_idstring(s3 only) AWS access key. Supports ${VAR}.
providers.storage.secret_access_keystring(s3 only) AWS secret key. Supports ${VAR}.
providers.storage.endpointstring(s3 only) Custom endpoint URL for S3-compatible stores.

Omit the auth: block entirely to disable authentication endpoints.

KeyTypeDefaultDescription
auth.jwt_expiryduration15m (when auth: is present)Access token lifetime. Default applies only when auth: block is declared but jwt_expiry is not.
auth.refresh_tokensbooleanfalseEnable refresh token issuance.
auth.refresh_token_expiryduration7dRefresh token lifetime (only used when refresh_tokens: true).
auth.allow_signupbooleantrueAllow public POST /auth/v1/signup. Set to false for invite-only.
auth.allow_anonymousbooleantrueAllow anonymous sign-in (empty-body signup).
auth.redirect_urlsstring[][]Allowlist of origins for post-auth redirects (OAuth, email verification). The server’s own origin is always allowed.
KeyTypeDefaultDescription
auth.email.verify_emailbooleanfalseRequire email verification before the user can sign in. Requires a configured email provider.
auth.email.templatesmapOverride built-in email templates by name (e.g. confirm, recovery).
auth.email.templates.<name>.subjectstringEmail subject line.
auth.email.templates.<name>.bodystringInline HTML/text body.
auth.email.templates.<name>.body_filestringPath to a file containing the body (alternative to body).

OAuth provider configuration. Providers are keyed by name under auth.oauth; the name (google, github, …) selects the built-in provider implementation.

KeyTypeDefaultDescription
auth.oauth.<name>.client_idstringOAuth client ID. Supports ${VAR}.
auth.oauth.<name>.client_secretstringOAuth client secret. Supports ${VAR}.
auth.oauth.<name>.redirect_urlstringOAuth callback URL registered with the provider.

Tables map to Postgres tables in the public schema by default. The migrator diffs this block against the live database on each boot.

tables:
posts:
schema: public # optional; default "public"
fields:
- name: id
type: bigserial
primary_key: true
- ...
indexes:
- ...
rls:
- ...
KeyTypeDefaultDescription
fields[].namestringrequiredColumn name.
fields[].typestringrequiredPostgres type (e.g. text, bigint, uuid, timestamptz, text[]).
fields[].primary_keybooleanfalseMark as primary key.
fields[].requiredbooleanfalseAdd NOT NULL constraint.
fields[].uniquebooleanfalseAdd UNIQUE constraint.
fields[].defaultanyColumn default. Supported: literal values, now(), current_date, current_time. The shorthand uuid_v7() and uuid_v4() are normalized to gen_random_uuid().
fields[].enumstring[]Restrict values to this list (creates a CHECK constraint).
fields[].patternstringRegex pattern for a CHECK constraint.
fields[].minnumberMinimum numeric value (inclusive).
fields[].maxnumberMaximum numeric value (inclusive).
fields[].checkstringRaw SQL CHECK expression.
fields[].foreign_key.referencesstringtable.column or schema.table.column.
fields[].foreign_key.on_deletestringrestrictcascade, restrict, or set_null. Defaults to restrict when omitted.
fields[].refstringStorage reference in the form storage.<bucket>.
fields[].on_deletestring(ref only) cascade or keep — whether to delete the object on row deletion.

No columns are injected automatically. Every column, including primary keys, must be declared.

KeyTypeDefaultDescription
indexes[].columnsstring[]requiredColumns to index.
indexes[].uniquebooleanfalseCreate a unique index.
indexes[].wherestringPartial index condition (SQL expression).

RLS is the only authorization layer. Declare policies here; instancez applies ENABLE ROW LEVEL SECURITY and creates the policies automatically.

KeyTypeDefaultDescription
rls[].operationsstring[]requiredOne or more of select, insert, update, delete.
rls[].checkstringrequiredSQL boolean expression evaluated per row.
rls[].typestringpermissivepermissive or restrictive.

Useful SQL helpers available in RLS expressions:

  • auth.uid() — UUID of the authenticated user (null for anonymous).
  • auth.is_authenticated() — true when the request carries a valid user JWT.

Bucket definitions. Buckets cannot be created, modified, or deleted at runtime; only instancez.yaml changes take effect.

storage:
avatars:
public: false
max_size: 5MB
types:
- image/png
- image/jpeg
rls:
- operations: [select]
using: "true"
KeyTypeDefaultDescription
storage.<name>.publicbooleanfalseAllow unauthenticated downloads via /storage/v1/object/public/....
storage.<name>.max_sizestring50MBMaximum file size per upload (e.g. 5MB, 1GB).
storage.<name>.typesstring[][]Allowed MIME types. Wildcards like image/* are accepted. Empty means all types allowed.
storage.<name>.rlsRLSPolicy[][]Same policy shape as table RLS, applied to storage.objects.

Postgres stored procedures exposed at /rest/v1/rpc/<name>.

rpc:
search_posts:
description: Full-text search
auth_required: false
language: plpgsql # sql | plpgsql (default: plpgsql)
volatility: stable # volatile | stable | immutable (default: volatile)
security: invoker # invoker | definer (default: invoker)
args:
- name: query
type: text
required: true
returns:
type: "setof posts"
body: |
SELECT * FROM posts WHERE body @@ plainto_tsquery(query);
KeyTypeDefaultDescription
rpc.<name>.descriptionstringDocumentation string.
rpc.<name>.auth_requiredbooleanfalseReject unauthenticated callers.
rpc.<name>.languagestringplpgsqlsql or plpgsql.
rpc.<name>.volatilitystringvolatilevolatile, stable, or immutable. Only stable/immutable can be called with GET.
rpc.<name>.securitystringinvokerinvoker or definer.
rpc.<name>.args[].namestringrequiredArgument name.
rpc.<name>.args[].typestringrequiredPostgres type.
rpc.<name>.args[].requiredbooleanfalseReturn 400 if argument is absent.
rpc.<name>.args[].defaultanyPostgres DEFAULT value for optional args.
rpc.<name>.returns.typestringReturn type: void, a scalar type, or setof <table>.
rpc.<name>.bodystringrequiredFunction body (PL/pgSQL or SQL).

JavaScript code functions served at /functions/v1/<name>. Distinct from rpc: (which declares Postgres stored procedures).

functions:
send_notification:
runtime: node
file: functions/send_notification.js
auth_required: true
timeout: 15s
env:
WEBHOOK_URL: https://hooks.example.com/notify
API_KEY: ${INSTANCEZ_ENV_NOTIFY_API_KEY}
KeyTypeDefaultDescription
functions.<name>.runtimestringrequired"node".
functions.<name>.filestringrequiredPath to the JS handler file, relative to the config root.
functions.<name>.auth_requiredbooleanfalseRequire a valid JWT. Returns 401 otherwise.
functions.<name>.timeoutduration30sPer-request timeout. Exceeded requests return 504.
functions.<name>.envmap{}Env values injected as ctx.env. Values may be string literals or ${INSTANCEZ_ENV_*} references.

INSTANCEZ_ENV_* references are resolved from the process environment. Plain ${VAR} references (without the INSTANCEZ_ENV_ prefix) are not supported in env: — use them elsewhere in the config file for other values.

Bundle pointer for self-hosted deployments. inz bundle produces the value (e.g. s3://bucket/key#sha256) and writes it here; the managed cloud stamps it server-side from uploaded sources. inz cloud deploy does not write this field.


version: 1
project:
name: My App
description: Example instancez project
server:
port: 8080
max_body_size: 5MB
max_limit: 500
cors:
origins: ["https://app.example.com"]
timeouts:
request: 30s
db_query: 10s
upload: 5m
shutdown: 30s
database:
pool:
max: 20
min: 5
idle_timeout: 300s
providers:
email:
type: resend
api_key: ${RESEND_API_KEY}
default_from_email: noreply@example.com
storage:
type: s3
bucket: my-app-storage
region: us-east-1
access_key_id: ${AWS_ACCESS_KEY_ID}
secret_access_key: ${AWS_SECRET_ACCESS_KEY}
auth:
jwt_expiry: 1h
refresh_tokens: true
refresh_token_expiry: 30d
allow_signup: true
allow_anonymous: false
redirect_urls:
- https://app.example.com
email:
verify_email: true
tables:
profiles:
fields:
- name: id
foreign_key:
references: auth.users.id
on_delete: cascade
primary_key: true
- name: display_name
type: text
- name: avatar_url
type: text
ref: storage.avatars
on_delete: keep
rls:
- operations: [select]
using: "true"
- operations: [insert]
with_check: "auth.uid() = id"
- operations: [update]
using: "auth.uid() = id"
with_check: "auth.uid() = id"
storage:
avatars:
public: true
max_size: 2MB
types: [image/png, image/jpeg, image/webp]
rls:
- operations: [insert]
with_check: "auth.uid() IS NOT NULL"
- operations: [delete]
using: "auth.uid() IS NOT NULL"
rpc:
profile_search:
language: sql
volatility: stable
args:
- name: q
type: text
required: true
returns:
type: "setof profiles"
body: |
SELECT * FROM profiles WHERE display_name ILIKE '%' || q || '%';
functions:
resize_avatar:
runtime: node
file: functions/resize_avatar.js
auth_required: true
timeout: 20s
env:
MAX_WIDTH: "512"