Configuration
The typegen tool is configured using the proofkit-typegen-config.jsonc
file at the root of your project.
JSONC is just JSON with comments. @proofkit/typegen
will also work with
standard JSON files.
The config key can also be an array of configs, which is useful if you need to connect to multiple databases, or with different settings for different sets of layouts.
{
"$schema": "https://proofkit.dev/typegen-config-schema.json",
"config": {
// ... your config here
},
}
Config options
Prop | Type | Default |
---|---|---|
generateClient? | boolean | true |
webviewerScriptName? | string | - |
clientSuffix? | string | Layout |
validator? | "zod/v4" | "zod/v3" | false | zod/v4 |
clearOldFiles? | boolean | true |
path? | string | "schema" |
envNames? | object | - |
layouts | array | - |
generateClient
(default: true
)
If set to false
, will only generate the zod schema and/or typescript types, but not the client files. Use this to customize the generated client, but still use the typegen tool to keep your schema up to date.
webviewerScriptName
If set, will generate the client using the @proofkit/webviewer package. This allows all calls to run via a FileMaker script rather than a network request. For more information, see the @proofkit/webviewer documentation.
clientSuffix
(default: "Layout"
)
The suffix to add to the client name.
For example, if the schemaName
is "Customers"
, the client name will be "CustomersLayout"
and you'll import it as import { CustomersLayout } from "./schema/client";
in your application code.
validator
(default: "zod/v4"
)
The validator to use for the schema. Can be "zod/v4"
or "zod/v3"
. If set to false
, only TypeScript types will be generated and no runtime validation will be performed when data is returned from the database.
clearOldFiles
(default: true
)
If set to true
, will delete all existing files in the output directory before generating new files. Useful to clean up old layouts that are no longer defined in the config.
path
(default: "schema"
)
The path to the directory where the generated files will be saved.
envNames
If set, will use the specified environment variable names for your FileMaker connection.
Only use the names of your environment variables, not the values for security reasons.
Layout options
The layouts
array in the config is where you define the layouts that you want to generate clients for. You must define at least one layout in the config.
Prop | Type | Default |
---|---|---|
strictNumbers? | boolean | - |
generateClient? | boolean | inherit |
valueLists? | "strict" | "allowEmpty" | "ignore" | "ignore" |
schemaName | string | - |
layoutName | string | - |
schemaName
(required)
The name of the schema to generate. This will end up being the name of the generated client and what you'll see most throughout your codebase.
layoutName
(required)
The name of the layout to generate a client for. Must match exactly the name of a layout in your FileMaker database.
strictNumbers
(default: false
)
If set to true
, will force all number fields to be typed as number | null
. This is useful if you want to ensure that all numbers are properly validated and not just strings.
By default, number fields are typed as string | number
because FileMaker may return numbers as strings in certain cases (such as very large numbers in scientific notation or blank fields). This ensures you properly account for this in your frontend code.
We suggest only turning on strictNumbers
if you are sure that your data will not hit these conditions or if you are also using a validator like Zod.
generateClient
(default: inherit
)
Use this setting to override the generateClient
setting from the root of the config.
valueLists
(default: "ignore"
)
"strict"
: Will force all value list fields to be typed as the actual value from the value list. This is useful if you want to ensure that all value list fields are properly validated and not just strings."allowEmpty"
: Will show the possible values from the value list, but also allow the value to be an empty string, which is the default behavior of FileMaker."ignore"
: Any value lists defined on fields in the layout will be ignored and typed asstring
.
Even if you ignore the value lists for type purposes, the value lists will still be available in the generated schema file for use in your own code.
This setting will apply to all fields with value lists in the layout. For more granular control, override the Zod schema using the extend
method. See the Transformations page for more details.