Generated Configuration Reference
Every declaration foir.config.ts is written against, emitted from the types
the CLI checks it with.
This is the exhaustive list. The Configuration Reference beside it is the one to read first: it carries the worked examples and the explanation of what a model, a lookup or a quota rule is for, which a type declaration cannot hold. This page exists so the exhaustive half is never the half that falls behind.
A member marked optional may be omitted. A member marked destination may differ between the named projects one config declares; every other member must be identical between them.
FieldPlacement
Where a field is edited, as distinct from what it holds. Most fields are content — what the record SAYS — and belong on the editor’s main form. A field that says where the record sits or how it is handled reads as noise beside the prose, so settings moves it to the record’s Settings tab instead. Presentation only: nothing about validation, storage or the published schema changes with it.
type FieldPlacement = 'content' | 'settings'SelectFieldConfig
| Member | Type | ||
|---|---|---|---|
optionModelKey | string | required | |
multiple | boolean | optional | |
options | never | optional | |
placement | FieldPlacement | optional |
EnumFieldOption
| Member | Type | ||
|---|---|---|---|
label | string | required | |
value | string | required |
EnumFieldConfig
enum is config-only: the storefront receives a typed string-literal union from inline {label, value} options. Variant overrides apply; locale overrides do not.
| Member | Type | ||
|---|---|---|---|
options | EnumFieldOption[] | required | |
multiple | boolean | optional | |
default | string | string[] | optional | |
placement | FieldPlacement | optional |
FieldGuardInput
Which sides of a field are guarded. A guarded side is read, or written, only by a holder of the grant that names the field: records:read:<model>.<field> or records:write:<model>.<field>, at a reach that covers the record. A grant on the model does not reach a guarded side, and one on every owner’s records of every model does. Give the field’s grants to the roles, keys and operations that read or write it. Omit for a field that follows its model.
| Member | Type | ||
|---|---|---|---|
read | boolean | optional | |
write | boolean | optional |
SelectFieldDefinitionInput
type SelectFieldDefinitionInput = BaseFieldDefinitionInput & { type: 'select'; config: SelectFieldConfig; }EnumFieldDefinitionInput
type EnumFieldDefinitionInput = BaseFieldDefinitionInput & { type: 'enum'; config: EnumFieldConfig; }FieldRelationshipInput
Relationship declaration on a reference field. composition makes records of this model OWNED BY their referenced parent — a single-valued foreign key with ON DELETE CASCADE: sharing and deletes (and later ownership) cascade parent → child. Only valid on a single (non-multiple) reference. association (the default) is a plain reference; the target keeps its own access + lifecycle. association_read is an association that ALSO lets whoever can read the referenced record read the referring one — read-only, one hop. hierarchy makes the field the model’s tree edge: foir answers path and ancestors by walking it, at most one per model and single-valued; its referenceTypes are unconstrained, since a parent need not share the child’s model. inverse names the reverse traversal (parent → children, e.g. a note’s blocks). The platform validates these at push (e.g. composition on a multiple reference is rejected).
| Member | Type | ||
|---|---|---|---|
kind | 'composition' | 'association' | 'association_read' | 'hierarchy' | required | |
inverse | string | optional |
ReferenceFieldConfig
| Member | Type | ||
|---|---|---|---|
referenceTypes | string[] | optional | Models this reference may target. Empty ⇒ any record-bearing model. |
unionName | string | optional | The name of the GraphQL union a reference to two or more models returns. Omitted, the union is named from its models (page and product give PageProductRef), which moves when the models do and which a model key can land on. A name given here stays put. Only for two or more referenceTypes: a reference to one model returns that model’s own type, and the platform refuses a name with nothing to name. Two fields may give one name only over the same models. |
multiple | boolean | optional | Many-valued reference. Composition is invalid when true. |
relationship | FieldRelationshipInput | optional | |
placement | FieldPlacement | optional |
ReferenceFieldDefinitionInput
type ReferenceFieldDefinitionInput = BaseFieldDefinitionInput & { type: 'reference'; config?: ReferenceFieldConfig; }FieldDefinitionInput
type FieldDefinitionInput = | SelectFieldDefinitionInput | EnumFieldDefinitionInput | ReferenceFieldDefinitionInput | GenericFieldDefinitionInputLookupDefinitionInput
Lookup definition — declares one indexed access path on a model. keyBy is the ordered list of top-level scalar field keys that make up the lookup key. Single-field lookups are common; composites are first-class (e.g. ['fromHost', 'fromPath'] for a redirect model). name overrides the generated GraphQL query field name; omit it to use <typeLowerCamel>By<PascalCaseKeyFields>. Validation runs server-side via the platform’s config-write RPC — see RFC §Data model → Constraints. The CLI does no local validation here; the server’s structured error surfaces verbatim on failure.
| Member | Type | ||
|---|---|---|---|
keyBy | string[] | required | |
name | string | optional |
AccessInput
Per-model access policy: the unified resource-access primitive’s BROAD layer. Mirrors the console’s model “Owner” plane control and the platform models.v1.AccessConfig. Declared here, it is reconciled into the model’s config by foir push, and takes effect for the published channel when the model is published; omit access entirely for a project-owned model, whose default visibility follows the rule on defaultVisibility below.
| Member | Type | ||
|---|---|---|---|
ownerPlane | 'user' | 'project' | 'organization' | required | Which plane owns records of this model: - 'user': owned by a person: the one the write names as the owner, else the person who writes it. Per-owner RLS isolation, private response-cache, per-owner lookups. Required for a per-user singleton. - 'project' — no individual owner; records belong to the project. The platform default. - 'organization' — owned by one of the project’s ORGANIZATIONS (the tenants of a SaaS built on this project). Ownership, not containment: the row stays in the project plane, so the project credential finds every organization’s rows — which is how a multi-tenant app resolves <sub>.theapp.com to an org before it knows which org the request is for. Written by the project (never for a person), owner named by ownerId or by the org the caller acts in (X-Org-Id); singleton means one record per organization. Refused on a project with no organizations and on a shared (layered/group) model. |
defaultVisibility | 'private' | 'public' | optional | Visibility new records start at (the record descriptor modes): - 'private' — only the owner and explicit grants. - 'public' — readable by anyone with API access, including signed-in users on the public API. On a PROJECT-plane model, omitting this defaults to 'public' at CREATION — project content is meant to be read, and 'private' there does not mean what it looks like: a project record has no owner, so it stays readable by anonymous and server-side callers while being hidden from signed-in users. Set 'private' explicitly to opt a project model out. The default is applied by the platform, at the create path only. Omitting it on a model that already exists means “leave it alone” — it will not reset a visibility you changed in the console. Owned planes (user, organization) are always private (the platform rejects a public default there) regardless of this value. |
ApplyConfigModelInput
| Member | Type | ||
|---|---|---|---|
key | string | required | |
name | string | required | |
pluralName | string | optional | |
pluralKey | string | optional | |
description | string | optional | |
fields | FieldDefinitionInput[] | optional | |
config | Record<string, unknown> | optional | |
access | AccessInput | optional | Per-model access policy (owner plane + default visibility). Reconciled into the model’s config by foir push, matching the console’s “Owner” plane control. Omit to leave the model at the platform default (project-owned). |
lookups | LookupDefinitionInput[] | optional | Lookup definitions for this model. Server validates: existence / scalar-type / top-level-only / caps (4 lookups, 4 fields) / GraphQL field-name regex for name. See RFC §Data model (config surface). |
QuotaRule
| Member | Type | ||
|---|---|---|---|
segmentKey | string | optional | Segment key to target (empty string or omitted = default/fallback). |
points | number | required | Max requests allowed in the window (0 = unlimited). |
duration | number | required | Window duration in seconds (3600=1hr, 86400=1day, 604800=7day, 2592000=30day). |
scope | 'user' | 'actor' | 'tenant' | required | Whose counter a run is charged to: user, the person the run is for; actor, whoever started it; or tenant, the workspace. |
condition | Record<string, unknown> | optional | Optional rule expression condition. |
expiresAt | string | optional | Optional expiry — rule is ignored after this date (ISO 8601). |
message | string | optional | Custom message returned when this rule’s quota is exhausted (e.g., upgrade CTA). |
failClosed | boolean | optional | Refuse the caller when this rule cannot be evaluated, instead of letting them through. Defaults to false, which is the behaviour every rule had before this field existed: if the meter is unreadable the request is allowed. Set it on a rule that protects something expensive, where serving an unmetered request costs more than refusing a legitimate one. It does not cover every failure. A rule whose own counter is unreadable refuses; a failure to load the rules at all has no rule to consult and still allows. |
ApplyConfigOperationInput
| Member | Type | ||
|---|---|---|---|
key | string | required | |
name | string | required | |
description | string | optional | |
icon | string | optional | |
category | string | optional | |
endpoint | string | optional, destination | HTTP endpoint URL that the platform calls when this operation is triggered. |
isActive | boolean | optional | |
timeoutMs | number | optional | |
inputSchema | Record<string, unknown> | optional | |
outputSchema | Record<string, unknown> | optional | |
quotas | { rules: QuotaRule[] } | optional | Usage quota rules (rate limits per user, actor or tenant). |
retryPolicy | Record<string, unknown> | optional | Retry policy for failed executions. |
allowedPermissions | string[] | optional | Permissions a console user must hold to execute this operation. CONJUNCTIVE: the caller must hold EVERY permission listed, so adding one always narrows who may execute. Omit or pass [] for no gate. Each entry is a permission as the role editor names it, with its reach where it has one, e.g. ['records:write.all', 'models:write']. An entry that is not a permission a console role can hold is refused when the config is pushed. Replaced allowedRoles, which named role KEYS. Role keys are yours to choose, so renaming a role silently changed who could execute. |
precondition | Precondition | optional | Precondition that must be met before execution (e.g., segment membership). |
mode | 'sync' | 'async' | optional | Execution mode the operation supports. sync is a direct call: the platform calls the endpoint and returns its answer to the caller, bounded by the operation’s timeoutMs, and the answer is the result. async dispatches with 202-ack semantics: the extension returns 202 immediately and calls back via the typed GraphQL mutation when work completes. Use async for work nobody waits on, or that runs longer than a caller can. There is only one flavour of async on the platform: the callback-based handshake. Every ASYNC dispatch carries a scoped callback token and the platform tracks the execution to terminal state. Default: sync. The CLI maps this to supportsAsync on the platform Operation row; the operation can still be called in SYNC mode at runtime when callers want a blocking call. |
callbackTtlSeconds | number | optional | How long the platform waits for a callback before marking the execution timed_out and (per retry policy) re-queueing or sending to DLQ. Omit for the platform default of 24h. Clamped to [5m, 7d]. Only meaningful when mode === 'async'. |
callbackTimeoutRetryPolicy | { maxRetries?: number } | optional | Retry policy applied specifically when the callback times out. Distinct from retryPolicy, which governs HTTP dispatch failures (network, 5xx). Splitting these lets users retry dispatch failures aggressively while being conservative about callback timeouts — re-running an hour-long job that timed out because the upstream was slow tends to burn another hour and hit the same slowness. Shape mirrors retryPolicy ({ maxRetries }). Falls back to retryPolicy when unset, then to the watchdog default (3). Set { maxRetries: 0 } to opt out of retry on timeout entirely. |
grants | string[] | optional | What the operation may do when its endpoint calls back into Foir, as grants in the permission catalogue’s names. Its dispatch token carries them, and so does the token for its callback window: nothing more. A record permission names its model: records:read:<model_key>, records:write:<model_key>, records:create:<model_key>, records:delete:<model_key>, records:publish:<model_key>. The write changes a record that is there and the create makes one, so an operation that does both declares both. List every model the operation touches. Ownership, records:attribute:<model_key> (or records:attribute for every model), lets the operation name the user a record belongs to when it creates one (create<Model>(input, ownerId)) and hand a record to another user (set<Model>Owner). It is held only by an operation: no API key of any type can be minted with it. The rest are written as the catalogue writes them: embeddings:read, embeddings:write, files:read, files:write, users:create (create a user, such as the buyer at a guest checkout), users:read.named (read one user the operation names, by id or by their exact email address), users:read.all (that, and the list), notifications:write.named (notify the project’s users; an operation acting for a user notifies that user alone, and one at an organisation reaches only its users), status:write, and secrets:read. A grant an operation may not declare is refused at push, by name. The whole list is at https://docs.foir.dev/api/operation-permissions . operations:complete is added to a callback token by the platform, so never declare it here. Omitting grants (or passing an empty array) mints a token that carries nothing, which suits an operation whose endpoint never calls back. |
readOnly | boolean | optional | The operation changes nothing. An agent calls a read-only operation without an approval, so it may declare only grants that read: a push that marks an operation read-only and gives it a write is refused. Declared, never read from kind: a query may still write. |
kind | 'mutation' | 'query' | 'field' | optional | How the operation surfaces in the public GraphQL schema and how it is dispatched. mutation (default) is the existing behaviour: an executeXxx root mutation dispatched via the worker queue. query registers a root Query field resolved synchronously in-process. field attaches a resolver field to attachedToModel, batched per request. QUERY/FIELD operations are the new “resolver” kind and use requestTemplate / responseTransform to call an upstream endpoint. A mutation with a requestTemplate is a pass-through write, called SYNC. |
attachedToModel | string | optional | Model key the resolver field attaches to. Required (and only meaningful) when kind === 'field'. |
parentFields | string[] | optional | Fields of the attachedToModel record sent to the resolver, where the request template reads them as {{parent.X}}. Only the fields named here are sent. FIELD only. |
cacheControl | { scope: 'PUBLIC' | 'PRIVATE' | 'NO_CACHE'; maxAge?: number } | optional | Cache-control for QUERY / FIELD resolver results. scope selects the cache audience; maxAge is the freshness window in seconds. |
secretBindings | Array<{ name: string; secretRef: string }> | optional | Maps {{secret.NAME}} placeholders in the request template to PROJECT-owned secrets. The dispatcher resolves plaintext at call time; it is never stored on the operation row. |
requestTemplate | { method?: string; pathTemplate?: string; query?: Record<string, string>; headers?: Record<string, string>; bodyTemplate?: string; batchCapable?: boolean; } | optional | The request Foir makes to a third-party host itself, for QUERY / FIELD operations and for a mutation called SYNC (a pass-through write, which cannot run ASYNC or from a hook). Template variables {{input.X}}, {{parent.X}}, {{secret.NAME}}, {{context.X}} are filled in at call time, each escaped for where it stands; {{context.idempotencyKey}} is the key the caller sent. The host is sent only what the template writes: no Foir token. Set batchCapable to send one upstream request for the whole deduped input set. |
responseTransform | string | optional | jq-style transform applied to the upstream response before it is returned to the caller: a QUERY / FIELD operation’s, or a templated mutation’s. |
ApplyConfigContextDimensionInput
A context dimension — the home for segments. sourceType: 'segment' carries an evaluationRules RuleExpression (evaluated fresh at request time into segment.<key>); sourceType: 'model' designates a user-context source model via sourceModelKey; sourceType: 'request' is a value the application sends in the contexts argument of a read, one of the records of the model sourceModelKey names. Reconciled config-scoped by foir push (owned via config_id): dimensions this config declares are created / updated, and config-owned dimensions dropped from the config are deleted.
| Member | Type | ||
|---|---|---|---|
key | string | required | |
name | string | required | |
description | string | optional | |
sourceType | string | required | ‘segment’ (rule-based) | ‘model’ (user-context source) | ‘request’ (a value sent with the read) | custom. |
evaluationRules | Record<string, unknown> | optional | Segment rule (sourceType ‘segment’) — a RuleExpression object. |
sourceModelKey | string | optional | The model the dimension is backed by. For sourceType ‘model’, a user-owned singleton. For sourceType ‘request’, a model whose records belong to the project as a whole: each record’s natural key is one value. |
defaultRecordKey | string | optional |
ApplyConfigLocaleInput
A project locale. Natural key is the locale code (e.g. “en-GB”). Reconciled by foir push — declared locales are created / updated. Locales are also console-editable and carry no config ownership, so a push never DELETES a locale it did not declare (create/update only).
| Member | Type | ||
|---|---|---|---|
locale | string | required | BCP-47 locale code, immutable after create (e.g. “en”, “fr-CA”). |
displayName | string | required | |
nativeName | string | optional | |
isDefault | boolean | optional | |
isActive | boolean | optional | |
isRtl | boolean | optional | |
fallbackLocale | string | optional | Locale code to fall back to when a translation is missing. |
ApplyConfigVariantCatalogEntryInput
A variant-catalog entry — a named targeting definition. Natural key is key. Reconciled by foir push (create/update only, same rationale as locales).
| Member | Type | ||
|---|---|---|---|
key | string | required | |
name | string | required | |
description | string | optional | |
targetingRules | Record<string, unknown> | optional | RuleExpression object evaluated to decide whether this variant applies. |
priority | number | optional | |
isDefault | boolean | optional | |
isActive | boolean | optional |
ApplyConfigEmailCopyInput
One transactional email’s wording, keyed by the action that sends it. actionKey names a send path — email.project.welcome, or a notification hook’s own key. The platform refuses one it does not recognise, because a row written under a typo is read by nothing and looks applied. Reconciled by foir push, create/update only: a workspace override is tenant-level and inherited by every project, so two projects in one workspace can name the same row and an omission must not delete what the other declares. Remove an override in the console.
| Member | Type | ||
|---|---|---|---|
actionKey | string | required | The send path this wording belongs to. |
locale | string | optional | BCP-47 locale. Defaults to en. |
scope | 'project' | 'workspace' | optional | project (default) or workspace, which every project inherits. |
subject | string | optional | |
heading | string | optional | |
body | string | optional | |
footer | string | optional | |
ctas | Array<{ label: string; url: string }> | optional |
ApplyConfigScheduleInput
| Member | Type | ||
|---|---|---|---|
key | string | optional | Unique key for this schedule. Defaults to operationKey if not provided. |
name | string | optional | Display name. Defaults to key if not provided. |
description | string | optional | |
operationKey | string | required | |
cron | string | required | |
timezone | string | optional | |
enabled | boolean | optional | |
each | 'organization' | optional | What one fire starts a run for. Left out, a fire starts one run, at the project’s own level. 'organization' starts one run in each active organization of the project, at every depth: each run is started in that organization, is confined to it, and holds what the operation declares. An organization that is suspended or scheduled for deletion gets no run. The operation must be one of the project’s own, not an app’s. |
ApplyConfigAuthProviderInput
| Member | Type | ||
|---|---|---|---|
key | string | required | |
name | string | required | |
type | string | required | |
config | Record<string, unknown> | optional | |
enabled | boolean | optional | |
isDefault | boolean | optional | |
priority | number | optional |
ApplyConfigAuthClientLoginMethods
Per-client login methods. All fields optional: a missing key is enabled. Lets a project’s storefront opt to only Sign in with Shopify (disable password/OTP + don’t list Apple) without touching the project-level provider catalogue.
| Member | Type | ||
|---|---|---|---|
password | boolean | optional | Show email & password sign-in on this auth client’s hosted sign-in? Defaults to true. Only narrows the project capability — can’t enable a method the project (passwordEnabled) has turned off. |
otp | boolean | optional | Show one-time code sign-in on this auth client’s hosted sign-in? Defaults to true. Only narrows the project capability (otpEnabled). |
disabledProviders | string[] | optional | Provider keys to HIDE on this auth client’s login page. Empty/missing = show every provider configured at the project level. List a key (e.g. “google”) to omit it from this auth client only. |
ApplyConfigAuthClientLogo
An app’s logo: exactly one of file or url, with alt text. A push refuses any other shape, naming the field.
| Member | Type | ||
|---|---|---|---|
file | string | optional, destination | One of the project’s public images, by its file id. Name this or url. |
url | string | optional, destination | An https address, shown as given. Name this or file. |
alt | string | required | What the logo shows, for a person who cannot see it. |
ApplyConfigAuthClientInput
| Member | Type | ||
|---|---|---|---|
clientId | string | required | Public auth client slug, unique per project (e.g. acme-storefront). |
name | string | required | Display name shown on the hosted sign-in. |
redirectUris | string[] | required, destination | Allow-listed redirect URIs the platform will 302 to with the code, e.g. ['https://app.eide.clothing/auth/callback']. Matched EXACTLY, including the path and query, so each deployment is listed in full. Wildcards are rejected rather than stored: a pattern would match only its own literal text, which reads like an allow-list entry and covers nothing. https, except on a loopback host (http://127.0.0.1:8976/callback) where a CLI or native app cannot hold a certificate. No fragment, no userinfo. |
grants | string[] | required | The most a sign-in through this app may carry of what the person’s roles give them, in the permission catalogue’s names: the same names a user role is declared with (https://docs.foir.dev/api/role-permissions ). The list gives nobody anything. A person holds what their roles give, and the list decides how much of it a token minted for this app carries. So it may hold a wildcard, which a role may not: ['*'] is an app that is not narrowed, and 'records:*' carries whatever its users hold over records. An entry covers its narrower forms: operations:execute here covers a person’s operations:execute:checkout. Required, and nothing is read into an absence: [] is an app whose sign-ins carry nothing of what its users’ roles give. A sign-in may ask for less with scope, in the same names. |
firstParty | boolean | optional | Whether this app is the project’s own. A sign-in through the project’s own app asks nobody to agree to it. Through any other app, each user is shown what it asks to carry for them and agrees to it once, and the token carries no more than they agreed. Leave it off for an app someone else runs. |
loginMethods | ApplyConfigAuthClientLoginMethods | optional | Per-client login method filter. Combines with the project- level user auth settings (project may have password OFF entirely; an auth client can’t override-up, only override-down). |
customDomains | string[] | optional, destination | White-label custom login domains for this auth client, e.g. ['login.eide.clothing']. foir push registers each (creating a pending row + a DNS-TXT challenge) and prunes any not listed. Verification is a separate step — add the CNAME + _foir-challenge TXT records the push output prints, then verify. |
postLoginUrl | string | optional, destination | Where a bare custom-domain (front-door) login lands after Foir sets the first-party session cookie — the app’s landing, not an OAuth callback. Empty falls back to the redirect URI. |
initiateLoginUri | string | optional, destination | An address in your app that starts its sign-in (OIDC’s initiate_login_uri). When someone accepts an invitation or resets their password on Foir’s hosted pages, they are sent here with iss, login_hint and target_link_uri, and your app signs them in as usual. Absent, they finish on the hosted page. https, or http on localhost. |
orgId | string | optional, destination | The organization of the project this app signs people in to, by its id, or '' for the whole project. Binding it elsewhere ends what it issued under its old binding: its people’s consents, the sessions signed in through it and its refresh tokens. Leave it out to keep the app where it is. |
promptsForOrganization | boolean | optional | Whether a sign-in through this app, naming no organization, asks somebody who may enter more than one place (the project, and the organizations they are a member of or may join) which organization they are going to. Somebody with exactly one organization goes straight there. The ID token says where (org_id). An app of the whole project only; off unless it says so, for an app whose people act across organizations at once. |
logo | ApplyConfigAuthClientLogo | optional | The app’s logo, shown with its name to a person asked to agree to it and in the lists of apps they have authorised, so they can see whose app is asking. Exactly one of file (one of the project’s public images, by id) or url (an https address), with alt. Leave it out for none. |
homepageUrl | string | optional, destination | The app’s homepage, an https address. The consent screen links the app’s name to it as the party asking. |
confidential | boolean | optional | Whether the app is confidential: a server that keeps a client secret, such as a tool with a generic OpenID Connect login. It authenticates with one of its secrets when it trades a code, refreshes and revokes, so it may leave PKCE out. A config never carries a secret: make one with foir auth-clients secrets create or in the console. Leave it out for a public app (a browser or a device), which proves each sign-in by PKCE. |
allowedOrigins | string[] | optional, destination | Browser origins allowed to exchange the first-party session cookie for an access token — i.e. the origins your SPA runs on, e.g. ['https://app.eide.clothing']. Exact origins: scheme + host + optional port, https only, no wildcards and no paths. This is the WHOLE allowlist for the credentialed session endpoints, matched exactly the way redirectUris are. List none and the SPA session does not work — there is no domain-wide default, deliberately: one would grant every origin on your domain, including a subdomain takeover or anything serving user content there. Absent leaves the list untouched; [] clears it. It is only meaningful alongside a verified customDomains entry (the cookie is only ever issued on one). |
loginPage | LoginPageConfig | optional | This app’s own sign-in page: only what differs from the page of the level it signs people in to. It is the project’s, as the app is. See {@link LoginPageConfig}. |
ApplyConfigPlacementInput
| Member | Type | ||
|---|---|---|---|
type | string | required | |
url | string | required, destination | |
allowedOrigin | string | optional, destination | |
height | number | optional | |
tabName | string | optional | |
hideContentTab | boolean | optional | |
modelKeys | string[] | optional |
ApplyConfigHookInput
| Member | Type | ||
|---|---|---|---|
key | string | optional | Unique key for this hook. |
name | string | optional | Display name. |
description | string | optional | Description of what this hook does. |
event | string | required | Lifecycle event that triggers this hook. |
operationKey | string | optional | Key of the operation to execute. |
filter | Record<string, unknown> | optional | Filter to scope the hook (e.g., { modelKey: 'redirect' }). |
isActive | boolean | optional | Whether the hook is active. Defaults to true. |
ApplyConfigApiKeyInput
| Member | Type | ||
|---|---|---|---|
name | string | required | Name for this API key (e.g. “Tilly iOS”, “Tilly CRM sync”). |
kind | 'publishable' | 'server' | 'admin' | required | What the key is for. You choose it, and the platform holds the key to what that kind may hold and give: - 'publishable' sits in a web page or an app, where anyone can read it. It gives a visitor only what is safe to give everyone. - 'server' is held by the server that renders your pages. It is a publishable key that may also say who and where its visitor is (visitors:forward), and it never goes to a browser. - 'admin' is a machine’s own: a sync job, a pipeline, a tool. It does what it holds, gives nobody anything, and nobody signs in through it. It expires. A key’s kind never changes. A config that declares another kind for a key that already exists is refused: declare a new key under a new name. |
envVar | string | required | Environment variable name to write the key to in .env (e.g. “FOIR_PUBLIC_KEY”). |
grants | string[] | required | What the key holds, in the permission catalogue’s names (e.g. [“records:read”, “records:write”]): for a publishable or a server key the most a signed-in user may do through it, and for an admin key what it does. An admin key may hold [”*”]. Declared for every key. Nothing is filled in, so a key declared without it would be minted holding nothing, and a push refuses one. A push changes it on the existing key in place: the key keeps its id and its secret, and the new list is live the moment the push writes it. |
baselineGrants | string[] | optional | What a publishable or a server key gives whoever comes through it, in the same names: a visitor with no sign-in, and a signed-in user beneath their role. An admin key gives nobody anything, and one declared with this list is refused. NOTHING IS FILLED IN. A key declared without this list gives a visitor nothing, whatever it holds: a publishable key holding records:read and no list here is a key no visitor can read with. Name each read a visitor needs. A visitor may also be given one model to submit into (records:create:<model>) and one operation to run (operations:execute:<operation>), each naming something this config declares. Declared, the list is the key’s whole second list and a push sets it in place. Left out, a push leaves what the key gives as it is. |
expiresIn | string | optional | An admin key only: how long it lives from the push that makes it, in days (e.g. “90d”, which is what it is given when nothing is said, up to “365d”). A publishable or a server key never expires, and one declared with this is refused. It is read when the key is made. A push never renews a key that exists: renew it with foir api-keys renew, so that a key is kept alive by somebody deciding to and not by a pipeline that happens to run. |
allowedModels | string[] | optional | The models whose records the key reads (e.g. [“tilly_note”, “tilly_block”]). A key that names none, and does not declare allModels, reads no model’s records. It keeps everything else it holds. |
allModels | boolean | optional | The key reads the records of every model, those added later among them. Declared beside allowedModels, it is refused. |
allowedFileTypes | string[] | optional | Restrict file uploads: a MIME type (“image/png”), a whole type (“image/*”), or IMAGE, VIDEO, FILE. |
org | string | optional | Confine the key to one ORGANISATION of this project, by id — the same value foir api-keys create --confine-to-org takes. An organisation is identified by a minted id, the way a project and a tenant are. A confined key reads and writes only that organisation’s rows plus the project-shared tier, and the confinement travels on the credential rather than on any request, so nothing downstream can widen it. It is also part of the key’s IDENTITY here, not just its configuration. Two organisations may each have a key named “Storefront”, so the reconciler matches on name AND organisation; a manifest that declared one and omitted this field would be matched against the other one’s key and rotate it. Set on CREATE only, like configId beside it: a key’s organisation cannot be changed afterwards, and a manifest that moved one would be asking for a credential to change which tenant it belongs to. |
ApplyConfigUserRoleInput
A role declared in foir.config.ts and reconciled by foir push. The role’s grants are what a user who holds it may do once signed in: their access token carries them. Roles are matched by key within the project: a declared key that already exists is updated in place, and a new key is created. A role on the platform that the config leaves out is left as it is, never disabled. Without a role, a signed-in user may do only what the key gives everyone who comes through it (its baselineGrants). Anything a user may do beyond that comes from a role they hold.
| Member | Type | ||
|---|---|---|---|
key | string | required | Stable key, unique per project (e.g. “default”, “member”). |
name | string | required | Human-readable name (e.g. “Default User”). |
grants | string[] | required | What the role gives users who hold it, as grants in the permission catalogue’s names: records:read:<model>, records:write:<model>, records:create:<model>, operations:execute, files:read and the rest of the list at https://docs.foir.dev/api/role-permissions . Each grant stands for itself. Changing a record and creating one are two grants, so a role that should do both lists records:write:<model> and records:create:<model>. A guarded field is given by the grants that name it, records:read:<model>.<field> and records:write:<model>.<field>. operations:execute runs every operation the key exposes; operations:execute:<operation_key> runs that one alone, so a role can let every user check out and keep rebooking for the users whose role gives it. A push naming an operation the project does not have is refused, by name. A push puts on a role only what the person pushing holds themselves. |
isDefault | boolean | optional | When true, every user in the project inherits this role with no per-user assignment. An app’s baseline user grant should be a single isDefault: true role. Defaults to false. |
AppMappingDeclined
Saying “I do not want this one” about a source or sink the manifest marks optional. EXPLICIT, BECAUSE SILENCE IS THE WRONG DEFAULT HERE. An optional source left out of the config could be a decision or an oversight, and the two have opposite consequences: one is a project that does not want its users synced, the other is a project that thinks they are and is wrong. So an optional source that is neither mapped nor declined is refused at push, with both spellings named. Nothing is submitted for a declined one, so the platform drops the operations that would have carried it and grants no capability for it. sources: { product: { toModel: ‘product’, naturalKey: ‘shopifyId’, fields: { … } }, user: false, // this project does not sync users }
type AppMappingDeclined = falseAppSourceMappingInput
Source-type mapping entry for an app install. Maps a manifest-declared source type onto a project model. See docs/platform/apps.md §Mapping step.
| Member | Type | ||
|---|---|---|---|
toModel | string | required | |
naturalKey | string | required | |
fields | Record<string, string> | required | |
mode | 'sync' | 'reference' | optional | How the install holds this source, when the app offers to read it live: 'reference' reads the host’s fields live and stores the record and its key; 'sync' keeps a copy. Omit it to leave the choice alone: a new install reads live wherever the app offers it, and a push never moves an existing install’s choice unless it names one. |
AppSinkMappingInput
Sink-contract mapping entry for an app install.
| Member | Type | ||
|---|---|---|---|
toModel | string | required | |
naturalKey | string | required | |
fields | Record<string, string> | required |
AppPlacementFieldChoiceInput
Placement field choice for TARGET_FIELD placements with field_selected_at_install=true. Keyed by placement.key.
| Member | Type | ||
|---|---|---|---|
model | string | required | |
field | string | required |
AppInput
Per-project app installation declared in foir.config.ts under apps.<name>. Platform state is reconciled against this at foir push time; the manifest is fetched from source each push.
| Member | Type | ||
|---|---|---|---|
source | string | required | https URL to the manifest JSON. |
settings | Record<string, unknown> | optional, destination | Opaque settings forwarded to the app’s middleware. |
userSignIn | string | false | optional | The user sign-in this install pairs with the app, for an app whose own system has users: the key of one of the project’s OAuth or OIDC user sign-ins, declared under authProviders. Every identity the app names is resolved through it. false pairs none. Leave it out to leave the install’s pairing alone: a push never removes a pairing it was not told about. |
mappings | { sources?: Record<string, AppSourceMappingInput | AppMappingDeclined>; sinks?: Record<string, AppSinkMappingInput | AppMappingDeclined>; placementFields?: Record<string, AppPlacementFieldChoiceInput>; } | optional |
ApplyConfigProjectSettingsInput
Project-level settings applied by foir push, in the same server-side transaction as every other family, and read via GetProject at pull time. Branding fields are empty-string-as-clear on the platform side: '' clears the column, undefined leaves it untouched.
| Member | Type | ||
|---|---|---|---|
displayName | string | optional | Display name in the project’s own emails and portal headers. |
logoUrl | string | optional | Public URL of the project logo (rendered in user emails). |
primaryColor | string | optional | Hex color used as accent in the project’s own emails. |
fromName | string | optional, destination | “From” name on outbound user emails. |
replyTo | string | optional, destination | “Reply-To” address on outbound user emails. |
supportEmail | string | optional, destination | Support email surfaced in email footers. |
appBaseUrl | string | optional, destination | Public base URL of the consumer-facing app (storefront, portal, internal tool, …). Reset / verify / invitation links in user emails are built from this — required before the platform will mint user-email links. |
termsUrl | string | optional, destination | The terms and privacy addresses every sign-in page links to in its footer, https. Blank or absent links to none. An organisation may set its own, and inherits these where it does not. |
privacyUrl | string | optional, destination | |
welcomeEmailEnabled | boolean | optional | Whether the platform sends a welcome email on user registration. Default true. Disable for invite-style flows. |
signupMode | SignupModeName | optional | Self-serve user signup mode. Default public. restricted accepts only invited emails, waitlist queues signups for approval, closed disables self-serve signup entirely. |
signupRestrictions | SignupRestrictionsInput | optional | Email hygiene + allow/block restrictions applied to public-mode signups. blockSubaddresses requires the canonical inbox form (rejects subaddress tags, Gmail dots, and the googlemail alias domain). An allowlist, when non-empty, is exclusive and beats the blocklist. List patterns: exact user@domain.com, whole domain (domain.com), wildcard subdomains (*.domain.com). |
passwordEnabled | boolean | optional | Whether email/password sign-in is exposed. Default true. Disable for a passwordless project (one-time codes or single sign-on only). |
otpEnabled | boolean | optional | Whether email one-time-code sign-in is exposed. Default false. |
organizationSignupEnabled | boolean | optional | Whether a signed-in user may register an organization of their own through createOrganization naming themselves as its founder. Default false. Needs organizationSignupRole to name the role the founder is given, or the platform refuses every registration. |
organizationSignupRole | string | optional | The key of the role a self-registered organization’s founder holds in it (a role of this project, e.g. 'user'). No default. |
organizationAssignableRoles | string[] | optional | The roles an organization’s own staffer may hand out, by key. THE CEILING ON WHAT AN ORGANIZATION CAN BECOME, set by the party that is not inside it. An organization’s staffer may add a member with a role only if the PROJECT declared that role assignable, which is why this is manifest-shaped and lives under project settings rather than anywhere an organization can reach. TRI-STATE, and the empty array is the point: omit it to leave the stored list alone, give a non-empty array to set it, and give an EMPTY array to take the capability away from every organization in the project. A bare “send nothing to clear” could not tell the last two apart. Every key must name a live role of this project. The platform refuses the whole list rather than dropping an entry it cannot resolve, because a list that quietly lost one is a capability a user believes they granted and did not. |
organizationUsers | 'joined' | 'everyone' | optional | Where somebody who comes in at an organization stands, for one that chooses nothing of its own: 'joined' (the default), at that organization, so they are its people and become another’s by joining it; or 'everyone', where the organization’s pool is kept, which is the project for one sharing the project’s pool, so they stand at every organization that shares it. A member of the project stands at every such organization either way. Changing it moves nobody. |
organizationOwnPool | boolean | optional | Whether a new organization at the top of the project signs its people in to a pool of its own when whoever makes it does not say. Default false: it shares the project’s. One made beneath another shares its parent’s pool unless asked otherwise. |
locksAccountsAfterFailedSignIns | boolean | optional | Whether ten wrong passwords for an address in an hour lock it from anywhere for an hour, not only from the IP they came from. Default false: a stranger who knows an address can’t lock its owner out. |
organizationJoining | 'invitation' | 'open' | 'request' | optional | Who may join an organization without an invitation, for one that chooses nothing of its own: 'invitation' (the default), only by invitation or staff adding them; 'open', someone who can already sign in at its page and is not a member joins by signing in there; or 'request', signing in there asks to join and its staff approve or decline. Nobody from another organization’s sign-in can join this way. |
anonymousNotesEnabled | boolean | optional | Whether the project takes a note from a visitor who is not signed in, through writeNote or <FoirFeedback>. Default false. A visitor also needs a publishable key that gives them notes:create. Turning it off refuses the next visitor’s note at once. |
noteScreenshotsEnabled | boolean | optional | Whether a signed-in user’s note may carry a screenshot, which <FoirFeedback> offers to capture. Default true. |
sites | SiteInput[] | optional | The project’s own websites. The whole list: a push replaces the project’s sites with it ([] removes them all), and leaving the key out leaves them alone. A site is matched to the project’s by its origin, so a push that changes a site’s name or switch changes that site. |
SiteInput
One of the project’s websites, as authored in config-as-code.
| Member | Type | ||
|---|---|---|---|
origin | string | required, destination | Its exact origin, such as https://www.example.com: https, a host and an optional port, no path. |
name | string | optional | What to call it. Default: its host. |
allowEditing | boolean | optional | Whether the site may frame the console’s field editor, so somebody signed in edits a field in place on it. Default false. A site that may frame a signed-in editor may also trick someone into clicking it, so allow it only on a site you control. |
SignupModeName
Self-serve signup mode, as authored in config-as-code.
type SignupModeName = 'public' | 'restricted' | 'waitlist' | 'closed'SignupRestrictionsInput
Email hygiene + allow/block restrictions, as authored in config-as-code.
| Member | Type | ||
|---|---|---|---|
blockSubaddresses | boolean | optional | |
blockDisposable | boolean | optional | |
allowlist | string[] | optional | |
blocklist | string[] | optional |
ApplyConfigProjectInput
Project pin + declarative settings. The pin (id / tenantId) is a guard against pushing one folder’s config into another folder’s project; the settings are applied by the push, on the server, with the rest of the config.
| Member | Type | ||
|---|---|---|---|
id | string | required, destination | Project id this folder is bound to. |
tenantId | string | required, destination | Tenant id of the bound project. |
name | string | optional, destination | Optional human-friendly name for diff readability. |
settings | ApplyConfigProjectSettingsInput | optional | Project-level settings reconciled by foir push. Omit to leave the platform settings untouched. foir pull populates this block from the live project state so the local config can be version-controlled. |
ApplyConfigDesignTokensInput
W3C Design Tokens Format Module document. The CLI applies this verbatim — references like “{font.size.display1}” are preserved on disk so renames in one place propagate to consumers. The platform’s resolver runs at write time and rejects cycles or unknown references. See foir-docs/content/platform/design-tokens.md for the full shape.
| Member | Type | ||
|---|---|---|---|
color | Record<string, unknown> | optional | |
font | { family?: Record<string, unknown>; weight?: Record<string, unknown>; size?: Record<string, unknown>; lineHeight?: Record<string, unknown>; letterSpacing?: Record<string, unknown>; } | optional | |
typography | Record<string, unknown> | optional |
ApplyConfigInput
A whole config manifest: every family foir push reconciles, plus the config’s own identity and the project pin. ⚠️ NO INDEX SIGNATURE, deliberately, and it used to have one. [key: string]: unknown made every top-level key legal, so a block spelled organisations instead of organizations — or one from a release this CLI does not have — type-checked, serialised, was accepted by the server’s equally tolerant parse and applied by nothing. Both sides agreed. Nothing errored. The block did nothing, for as long as nobody looked. Without the signature, TypeScript’s excess-property check refuses the literal at the point somebody writes it, which is the cheapest place this can possibly be caught. The server reports what it did not recognise as well, because a type check is only one of the two sides and a manifest can reach it from a hand-written JSON, an older CLI, or a generator. ───────────────────────────────────────────────────────────────────────────── WHAT A PUSH DOES TO ORGANISATIONS A PUSH NEVER CREATES, MOVES, SUSPENDS OR DELETES AN ORGANISATION. Stated on the server too, beside the parser that would have to grow a family for it (organisationPushRule in the configs handler), because a rule held in one repository is a rule the other can contradict. Organisation POLICY is manifest-shaped and belongs here: whether self-serve sign-up is on, which role a founder is given, which roles an organisation may assign. Organisation INSTANCES are management state, like a user or a credential’s last use — created by a user, by a user signing up, or by a provisioning call, and suspended or deleted by deliberate acts with their own confirmations and their own audit trail. The reason it has to be said rather than assumed is this file’s own prune rule: a family a manifest OMITS is a family whose resources this config owns and no longer wants. Apply that to organisations and a founder who pushed a config without an organisations block would lose a live tenant — every row, every user, every credential — because a file did not mention it.
| Member | Type | ||
|---|---|---|---|
key | string | required | |
name | string | required | |
configType | string | optional | |
force | boolean | optional | |
description | string | optional | Free text on the config row, for a reader rather than for the platform. Nothing resolves against it. |
direction | string | optional | Which way content moves for this config: 'READ' (the default), 'write', 'bidirectional'. Recorded on the config row. A STRING. It was undeclared here until the manifest’s top level gained a type at all, and one config in this repository had been sending the number 1 — which made the SERVER’S metadata decode fail outright, so that manifest’s name, description and configType fell through to defaults on every push. One key of the wrong type, every metadata field silently dropped, nothing reported anywhere. |
connectionDomain | string | optional | The domain a connector-shaped config talks to. Recorded on the row. |
operationBaseUrl | string | optional, destination | Base URL prepended to relative operation endpoints. |
project | ApplyConfigProjectInput | optional | Project pin + declarative project-level settings. The pin guards against cross-folder mis-pushes; the settings (when present) are applied to the platform alongside the model / operation reconcile. |
models | ApplyConfigModelInput[] | optional | |
operations | ApplyConfigOperationInput[] | optional | |
contextDimensions | ApplyConfigContextDimensionInput[] | optional | |
locales | ApplyConfigLocaleInput[] | optional | Project locales, reconciled by foir push (create/update only). |
variantCatalog | ApplyConfigVariantCatalogEntryInput[] | optional | Variant-catalog entries, reconciled by foir push (create/update only). |
schedules | ApplyConfigScheduleInput[] | optional | |
hooks | ApplyConfigHookInput[] | optional | |
authProviders | ApplyConfigAuthProviderInput[] | optional | |
authClients | ApplyConfigAuthClientInput[] | optional | |
placements | ApplyConfigPlacementInput[] | optional | |
apiKeys | ApplyConfigApiKeyInput[] | optional | |
userRoles | ApplyConfigUserRoleInput[] | optional | User RBAC roles, reconciled by foir push. Declare an isDefault: true role to grant every user the write/execute scopes their tokens need — without one, users get read-only tokens after the Model B auth change. |
apps | Record<string, AppInput> | optional | Per-project app declarations, keyed by app name. |
designTokens | ApplyConfigDesignTokensInput | optional | W3C-formatted design tokens document for this project. Reconciled by foir push — the document is applied verbatim to the draft channel. Add --publish to promote draft → published in the same push. |
loginPage | LoginPageConfig | optional | The project’s default sign-in page. Each field set here overrides Foir’s default; a field left out is inherited. An app’s own page goes on its authClients entry. A config belongs to the project, so an organisation keeps its page with foir login-page instead. Saved as a draft, released with everything else (--publish). See {@link LoginPageConfig}. |
emailCopy | ApplyConfigEmailCopyInput[] | optional | Transactional email wording, reconciled by foir push (create/update only — see ApplyConfigEmailCopyInput for why it never prunes). |
projectEmail | ApplyConfigProjectEmailInput | optional | The project’s bring-your-own transactional email sender: fromEmail and a resendKeySecretRef. REF ONLY — the raw key is never in the committed manifest; it is written out of band with foir secrets put and this references the resulting vault ref. Omitted leaves the sender unchanged. |
agents | ApplyConfigAgentInput[] | optional | The project’s agents, reconciled by foir push: created, updated, and deleted when this config owns one it no longer declares. |
brief | ApplyConfigBriefInput | optional | The project brief. Written when it changes, never deleted by a push. |
AgentToolInput
One tool an agent may use: one of Fóir’s verbs, one of the project’s operations, one tool of a remote MCP server registered on the agent, or another agent as a child. A tool the caller’s own role does not grant is not offered to their run.
type AgentToolInput = ( | { verb: string; models?: string[]; } | { operation: string } | { mcpServer: string; mcpTool: string } | { agent: string } ) & { unattended?: boolean; }AgentMcpServerInput
A remote MCP server registered on an agent, called over HTTP.
| Member | Type | ||
|---|---|---|---|
name | string | required | |
url | string | required, destination | The server’s address. It must be public: a private address is refused. |
credential | 'none' | 'project' | 'perUser' | optional | Whose credential the server is called with: none, the project’s (a vault secret named by secretRef), or each person’s own account, connected by them in the app. |
secretRef | string | optional | |
oauth | { authorizationUrl?: string; tokenUrl?: string; clientId?: string; clientSecretRef?: string; scopes?: string[]; } | optional | |
tools | { name: string; description?: string; inputSchema?: Record<string, unknown>; readOnly?: boolean; allowed?: boolean; }[] | required | The tools of the server an agent may use, pinned as discovered. A tool not marked readOnly waits for an approval unless it is marked allowed. |
timeoutMs | number | optional |
ApplyConfigAgentInput
An agent: instructions, a model, the tools it may use, and its limits. It runs as whoever calls it, with that caller’s permissions, and an act it cannot draft waits for an approval. Saved as a draft and released with everything else (--publish).
| Member | Type | ||
|---|---|---|---|
key | string | required | Lowercase letters, digits and _, starting with a letter. It is the agent’s name everywhere: in the data API, in a key’s grants (agents:execute:<key>) and in the console. |
name | string | required | |
description | string | optional | |
instructions | string | optional | |
model | | { tier: 'fast' | 'balanced' | 'best' } | { provider: 'anthropic' | 'openai'; model: string; secretRef: string; monthlyCapUsd: number; } | optional | A tier of Fóir’s (fast, balanced or best), run on AI credits, or the project’s own provider key with a monthly spend cap in dollars. |
tools | AgentToolInput[] | optional | |
mcpServers | AgentMcpServerInput[] | optional | |
limits | { maxCreditsPerRun?: number; maxSteps?: number; maxMessageChars?: number; maxTurns?: number; maxDepth?: number; quotas?: { rules: QuotaRule[] }; } | optional | |
retentionDays | number | optional | How long a thread with the agent is kept after its last message. |
refusalRules | { key: string; when: Record<string, unknown>; message: string }[] | optional | The project’s own rules a public conversation is held to. |
notifyOthersUnheld | boolean | optional | Let the agent notify people other than its caller without an approval. |
teamApproves | boolean | optional | Hand every held act to the team, never to the caller. |
outputSchema | Record<string, unknown> | optional | The JSON Schema a run’s answer is held to, describing an object. A run ends with a value that fits it, read as the run’s output, rather than with prose. |
dataParts | { name: string; description?: string; schema: Record<string, unknown> }[] | optional | Data the agent may send an app’s own components as it answers. Each is held to its JSON Schema and reaches the app as a data-<name> part. |
pageTools | boolean | optional | The agent may use the tools the caller’s page offers with a message. The page defines them, in foirChatTransport’s pageTools; the model calls one, and the run waits for the page to say what it did. |
history | | { keep: 'everything' } | { keep: 'answers' } | { keep: 'recent'; turns: number } | { keep: 'compact'; afterTokens: number; recentTurns?: number } | optional | How the agent’s conversations carry their earlier turns to the model. Unset, or everything, they go in full, with every tool call and its result: right where a later turn acts on what an earlier one found. answers sends each earlier turn as its question and its answer. recent sends the last turns in full and those before as answers. compact writes the earlier turns into a summary once they pass about afterTokens tokens, keeping the last recentTurns word for word; the summary is written on the fast tier, charged to the run that writes it, and used again until the turns after it pass the size in turn. |
ApplyConfigBriefInput
The project brief: house rules every declared agent is given ahead of its own instructions, and that an agent connecting as a person reads.
| Member | Type | ||
|---|---|---|---|
text | string | required | |
modelRules | Record<string, string> | optional | Rules for particular models, by model key. |
ApplyConfigProjectEmailInput
The project’s own email sender, as authored in config-as-code.
| Member | Type | ||
|---|---|---|---|
fromEmail | string | optional, destination | |
resendKeySecretRef | string | optional, destination | A vault ref, never a key. foir secrets put mints one. |
DestinationValue
One value a named project supplies for a destination: a URL, an address, a list of them, or an app’s settings.
type DestinationValue = string | string[] | Record<string, unknown>DestinationValues
A named project’s destinations, under the names the manifest reads them by.
type DestinationValues = Record<string, DestinationValue>NamedProjectInput
One named project: an ordinary project this config pushes to when selected with --project <name> or FOIR_PROJECT=<name>. The platform never learns that two named projects are related. What makes them one config is that the CLI resolves the manifest once per project and refuses a push when any two differ in a field that is not a destination.
| Member | Type | ||
|---|---|---|---|
id | string | required | The project’s id. |
tenantId | string | required | The id of the project’s tenant. |
name | string | optional | A human-friendly name for output. |
envFile | string | required | The file this project’s minted keys and signing secrets are written to, relative to the config. Two named projects may not share one. |
apiUrl | string | optional | The control plane this project lives on. Omit for the production control plane. A command pointed anywhere else, or holding a session minted anywhere else, is refused unless it passes --allow-control-plane-mismatch. |
destinations | D | required | The values that may differ between named projects: endpoints, redirect URIs, origins, sender addresses and the like. The manifest reads them from the project it is resolved for. Every named project supplies the same names. |
SelectedNamedProject
What the manifest function is given: the project it is resolved for.
| Member | Type | ||
|---|---|---|---|
name | string | required | The name this project is declared under in projects. |
destinations | D | required |
NamedProjectManifest
The manifest a named-projects config resolves to, for one project. The same shape as a single-project manifest, less the pin: a named project’s id, tenantId and name come from its entry in projects, so project here carries only its settings.
| Member | Type | ||
|---|---|---|---|
project | { settings?: ApplyConfigProjectSettingsInput } | optional |
FoirProjectsConfig
A config that declares several full projects by name. manifest is called once per declared project, with that project’s destinations. Only destinations may differ between the results: a push refuses, before anything is sent, when two resolved manifests differ in any other field, and names the field and both values.
| Member | Type | ||
|---|---|---|---|
projects | Record<string, NamedProjectInput<D>> | required | |
manifest | ( project: SelectedNamedProject<D> ) => NamedProjectManifest | Promise<NamedProjectManifest> | required |
SecretOwnerKind
type SecretOwnerKind = 'project' | 'app'SecretDeclaration
One declared secret. label is the human-readable handle the reconciler uses to look the secret up in the vault — no opaque ref is committed. ownerId is required for app-owned secrets and ignored for project-owned ones.
| Member | Type | ||
|---|---|---|---|
ownerKind | SecretOwnerKind | required | |
ownerId | string | optional | |
label | string | required |
FoirSecretsConfig
Shape of a foir.secrets.ts default export.
| Member | Type | ||
|---|---|---|---|
secrets | SecretDeclaration[] | required |
LoginPageConfig
A sign-in page: what the hosted sign-in shows around Foir’s own form. Each top-level field is taken from the first of these that sets it: the app’s own page, the organisation the sign-in is for and each one above it, the project’s, then Foir’s default (the centred page with nothing around the form). Lists are replaced whole, never merged. Colours, the font and the corner radius name design tokens, never values, so the sign-in matches what an app built on the same tokens shows. No raw HTML anywhere: a project that wants full control writes its own sign-in page on the public API.
| Member | Type | ||
|---|---|---|---|
layout | | 'centred' | { split: { side?: 'left' | 'right'; width?: 'half' | 'fortySixty'; onPhones?: 'band' | 'hide' } } | { fullBleed: { card?: 'centre' | 'left' | 'right'; scrim?: 'soft' | 'medium' | 'strong' } } | optional | 'centred' (Foir’s default), a split panel, or a full-bleed background. |
media | { colour?: LoginPageColour; image?: LoginPageImage; slideshow?: { images: LoginPageImage[]; autoplay?: boolean }; video?: LoginPageVideo; } | optional | The split panel or the full-bleed background: a colour, and at most one of an image, a slideshow or a video. A video here plays as a loop, muted. |
content | LoginPageItem[] | optional | What sits beside the form and over the media, in order. [] shows nothing. |
pageColour | LoginPageColour | optional | The colour behind the form. |
font | string | optional | A fontFamily design token, e.g. 'font.family.body'. |
radius | string | optional | A radius design token, e.g. 'radius.md'. |
LoginPageColour
A colour by design token: one for light, one for dark (falls back to light).
| Member | Type | ||
|---|---|---|---|
light | string | required | |
dark | string | optional |
LoginPageText
A string per locale, e.g. { en: 'Welcome back', fr: 'Bon retour' }.
type LoginPageText = Record<string, string>LoginPageProse
Text per locale: a string (one paragraph), a list of passages, or a prose flow ({ v: 1, entries: [...] }) for marks, links and lists.
type LoginPageProse = Record< string, | string | Array<{ kind?: 'paragraph' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'quote'; token?: string; text: string }> | { v: 1; entries: unknown[] } >LoginPageImage
One use of an image: exactly one of a Foir file (file: a public image of the project’s own files or of the page’s own level, served in sized versions) or an https address (url, shown as given, never fetched by Foir), with alt text in the default locale.
type LoginPageImage = ({ file: string; url?: never } | { url: string; file?: never }) & { alt: LoginPageText; caption?: LoginPageText; focalPoint?: { x: number; y: number }; crop?: { x: number; y: number; width: number; height: number }; }LoginPageVideo
One use of a video: exactly one of a Foir file (file: a public MP4 or WebM of the project’s own files or of the page’s own level) or an https address of an MP4 or WebM (url, played as given, never fetched by Foir), with alt text in the default locale. A video has no crop.
type LoginPageVideo = ({ file: string; url?: never } | { url: string; file?: never }) & { alt: LoginPageText; caption?: LoginPageText; focalPoint?: { x: number; y: number }; poster?: { file: string; url?: never } | { url: string; file?: never }; playback?: 'loop' | 'controls'; }LoginPageState
The states the sign-in page opens in.
type LoginPageState = 'signIn' | 'signUp' | 'waitlist' | 'waitlistJoined' | 'inviteOnly' | 'closed'LoginPageItem
One piece of content: exactly one of heading, text, image, gallery or video.
type LoginPageItem = ( | { heading: LoginPageText } | { text: LoginPageProse } | { image: LoginPageImage } | { gallery: { images: LoginPageImage[] } } | { video: LoginPageVideo } ) & { states?: LoginPageState[]; region?: 'besideForm' | 'overMedia'; }Destinations
A config that declares named projects resolves its manifest once per project, and only these fields may differ between the results. A push that finds any other difference refuses before anything is sent, and names the field and both values. The same fields are left out of the manifest hash a push records, so two projects holding one commit hold one hash.
They are marked in the contract, as the destination option on configs/v1/manifest.proto,
and this list is generated from the marks: adding a destination is one option on one field.
| Field | Declared on |
|---|---|
operationBaseUrl | ApplyConfigInput |
project.id | ApplyConfigProjectInput |
project.tenantId | ApplyConfigProjectInput |
project.name | ApplyConfigProjectInput |
project.settings.fromName | ApplyConfigProjectSettingsInput |
project.settings.replyTo | ApplyConfigProjectSettingsInput |
project.settings.supportEmail | ApplyConfigProjectSettingsInput |
project.settings.appBaseUrl | ApplyConfigProjectSettingsInput |
project.settings.termsUrl | ApplyConfigProjectSettingsInput |
project.settings.privacyUrl | ApplyConfigProjectSettingsInput |
project.settings.sites[].origin | SiteInput |
operations[].endpoint | ApplyConfigOperationInput |
authClients[].redirectUris | ApplyConfigAuthClientInput |
authClients[].customDomains | ApplyConfigAuthClientInput |
authClients[].postLoginUrl | ApplyConfigAuthClientInput |
authClients[].allowedOrigins | ApplyConfigAuthClientInput |
authClients[].initiateLoginUri | ApplyConfigAuthClientInput |
authClients[].orgId | ApplyConfigAuthClientInput |
authClients[].logo.file | ApplyConfigAuthClientLogo |
authClients[].logo.url | ApplyConfigAuthClientLogo |
authClients[].homepageUrl | ApplyConfigAuthClientInput |
placements[].url | ApplyConfigPlacementInput |
placements[].allowedOrigin | ApplyConfigPlacementInput |
apps.*.settings | AppInput |
emailCopy[].ctas[].url | ApplyConfigEmailCopyInput |
projectEmail.fromEmail | ApplyConfigProjectEmailInput |
projectEmail.resendKeySecretRef | ApplyConfigProjectEmailInput |
agents[].mcpServers[].url | AgentMcpServerInput |
agents[].mcpServers[].oauth.authorizationUrl | AgentMcpServerInput |
agents[].mcpServers[].oauth.tokenUrl | AgentMcpServerInput |
agents[].mcpServers[].oauth.clientId | AgentMcpServerInput |